Skip to content

Strange: uri not a URI #825

Description

@amomchilov

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions