Created
May 25, 2020 18:36
-
-
Save dunglas/ec793690f66167cb849c02284ecf748d to your computer and use it in GitHub Desktop.
URI Template test in Ruby
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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