3

If I have an addressable object like this:

uri = Addressable::URI.parse("http://example.com/path/to/resource/")

How would I get back the "http://example.com/path/to/resource/" - I have looked at uri.methods, but I fail to see which one would I use to get back the full URI.

Hommer Smith
  • 26,772
  • 56
  • 167
  • 296

1 Answers1

8

Use to_s method:

uri = Addressable::URI.parse("http://example.com/path/to/resource/")
uri.to_s
# => "http://example.com/path/to/resource/"

See URI - basic example.

falsetru
  • 357,413
  • 63
  • 732
  • 636