Class: Songle::SongURI::NumericSongURI
- Inherits:
-
Object
- Object
- Songle::SongURI::NumericSongURI
- Includes:
- Songle::SongURI
- Defined in:
- lib/songle/song_uri/numeric_song_uri.rb
Constant Summary collapse
- TYPE =
"numeric"- URI_REGEXP =
/^(|[\w.]+\/[\w.]+\/|\/\/[\w.]+\/[\w.]+\/|http(|s):\/\/[\w.]+\/[\w.]+\/)(\d+)$/
Constants included from Songle::SongURI
ENDPOINT_HOST, ENDPOINT_PATH, ENDPOINT_SCHEME
Instance Attribute Summary
Attributes included from Songle::SongURI
#endpoint_host, #endpoint_path, #endpoint_scheme, #source_host, #source_id, #source_path
Instance Method Summary collapse
-
#initialize(query_string, options) ⇒ NumericSongURI
constructor
A new instance of NumericSongURI.
- #to_s ⇒ Object
- #type ⇒ Object
Methods included from Songle::SongURI
Constructor Details
#initialize(query_string, options) ⇒ NumericSongURI
Returns a new instance of NumericSongURI.
18 19 20 21 22 23 24 |
# File 'lib/songle/song_uri/numeric_song_uri.rb', line 18 def initialize query_string, super() @source_host = nil @source_path = nil @source_id = $3 if query_string =~ URI_REGEXP end |
Instance Method Details
#to_s ⇒ Object
36 37 38 |
# File 'lib/songle/song_uri/numeric_song_uri.rb', line 36 def to_s return "#{ self.endpoint }#{ @source_id }" end |
#type ⇒ Object
29 30 31 |
# File 'lib/songle/song_uri/numeric_song_uri.rb', line 29 def type return TYPE end |