Contrary to its name, Rubydex::Declaration#uri returns a String. Real users need to use URI.parse(x.uri).path to get what they really wanted, which was the path.
I think we can both improve the ergonomics, and the naming (for least astonishment).
Proposal:
- #: -> String
+ #: -> URI
def uri; end
+ #: -> Pathname
+ def pathname; end # Perhaps just `path`, it'll be very commonly used
+ #: -> String
+ def uri_string # Returns the raw URI as a string, like `#uri` does today.
Contrary to its name,
Rubydex::Declaration#urireturns aString. Real users need to useURI.parse(x.uri).pathto get what they really wanted, which was the path.I think we can both improve the ergonomics, and the naming (for least astonishment).
Proposal: