Class: Simpl::Url
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, options = {}) ⇒ Url
constructor
required: url to be shortened.
-
#shortened ⇒ Object
returns: a string respresenting the shortened url note: may be still the full url should a problem occur.
Constructor Details
#initialize(url, options = {}) ⇒ Url
required: url to be shortened
12 13 14 15 16 17 18 19 |
# File 'lib/simpl/url.rb', line 12 def initialize(url, = {}) # sets the URL to be shortened self.url = url # allows an instance-level override for the api key @api_key = [:api_key] # allows an instance-level override for the timeout @timeout = [:timeout] end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
9 10 11 |
# File 'lib/simpl/url.rb', line 9 def url @url end |
Instance Method Details
#shortened ⇒ Object
returns: a string respresenting the shortened url note: may be still the full url should a problem occur
23 24 25 |
# File 'lib/simpl/url.rb', line 23 def shortened @shortened ||= shorten end |