Skip to content

Instantly share code, notes, and snippets.

@dunglas
Created May 25, 2020 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dunglas/ec793690f66167cb849c02284ecf748d to your computer and use it in GitHub Desktop.
Save dunglas/ec793690f66167cb849c02284ecf748d to your computer and use it in GitHub Desktop.
URI Template test in Ruby
require "addressable/template"
template = Addressable::Template.new(
"https://example.net/{ip}"
)
uri = Addressable::URI.parse(
"https://example.net/2001:db8::35"
)
puts template.extract(uri).inspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment