Class: Yt::Models::URL
- Inherits:
-
Object
- Object
- Yt::Models::URL
- Defined in:
- lib/yt/models/url.rb
Instance Attribute Summary collapse
-
#kind ⇒ Object
readonly
Returns the value of attribute kind.
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(url) ⇒ URL
constructor
A new instance of URL.
- #username ⇒ Object
Constructor Details
#initialize(url) ⇒ URL
Returns a new instance of URL.
6 7 8 9 10 |
# File 'lib/yt/models/url.rb', line 6 def initialize(url) @url = url @kind ||= parse url @match_data ||= {} end |
Instance Attribute Details
#kind ⇒ Object (readonly)
Returns the value of attribute kind.
4 5 6 |
# File 'lib/yt/models/url.rb', line 4 def kind @kind end |
Instance Method Details
#id ⇒ Object
12 13 14 15 |
# File 'lib/yt/models/url.rb', line 12 def id @match_data[:id] rescue IndexError end |
#username ⇒ Object
17 18 19 20 |
# File 'lib/yt/models/url.rb', line 17 def username @match_data[:username] rescue IndexError end |