Class: Yourls::Url
- Inherits:
-
Object
- Object
- Yourls::Url
- Defined in:
- lib/yourls/url.rb
Instance Attribute Summary collapse
-
#keyword ⇒ Object
readonly
Returns the value of attribute keyword.
-
#long_url ⇒ Object
readonly
Returns the value of attribute long_url.
-
#short_url ⇒ Object
readonly
Returns the value of attribute short_url.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Url
constructor
A new instance of Url.
Constructor Details
#initialize(options = {}) ⇒ Url
Returns a new instance of Url.
5 6 7 8 9 10 11 12 |
# File 'lib/yourls/url.rb', line 5 def initialize( = {}) if url = ['url'] || Hash.new('') @short_url = ['shorturl'] @long_url = ['longurl'] || url['url'] @keyword = ['keyword'] || url['keyword'] end end |
Instance Attribute Details
#keyword ⇒ Object (readonly)
Returns the value of attribute keyword.
3 4 5 |
# File 'lib/yourls/url.rb', line 3 def keyword @keyword end |
#long_url ⇒ Object (readonly)
Returns the value of attribute long_url.
3 4 5 |
# File 'lib/yourls/url.rb', line 3 def long_url @long_url end |
#short_url ⇒ Object (readonly)
Returns the value of attribute short_url.
3 4 5 |
# File 'lib/yourls/url.rb', line 3 def short_url @short_url end |