Class: URI::Generic
Overview
accessibility-core
extensions to the URI
family of classes
Instance Method Summary collapse
-
#lastPathComponent ⇒ String
Return the last component of the path of the URL.
-
#pathExtension ⇒ String
Returns the path extension of a file URL.
-
#to_url ⇒ URI::Generic
Returns the receiver (since the receiver is already a
URI
object).
Instance Method Details
#lastPathComponent ⇒ String
Return the last component of the path of the URL
This is intended to help make URI::Generic closer to being a drop-in replacement for NSURL.
122 123 124 |
# File 'lib/accessibility/bridge/mri.rb', line 122 def lastPathComponent self.path.split(%r{/+}).last end |
#pathExtension ⇒ String
Returns the path extension of a file URL
This is intended to help make URI::Generic closer to being a drop-in replacement for NSURL.
138 139 140 141 |
# File 'lib/accessibility/bridge/mri.rb', line 138 def pathExtension split = self.path.split '.', -1 split.size > 1 ? split.last : '' end |
#to_url ⇒ URI::Generic
Returns the receiver (since the receiver is already a URI
object)
106 107 108 |
# File 'lib/accessibility/bridge/mri.rb', line 106 def to_url self end |