Class: Bitly::ShortenResponse
- Defined in:
- lib/providers/bitly/response.rb
Instance Attribute Summary collapse
-
#global_hash ⇒ Object
readonly
Returns the value of attribute global_hash.
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#long_url ⇒ Object
readonly
Returns the value of attribute long_url.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Attributes inherited from Response
Instance Method Summary collapse
-
#parse ⇒ Object
Assuming format is always json for now.
Methods inherited from Response
Constructor Details
This class inherits a constructor from Bitly::Response
Instance Attribute Details
#global_hash ⇒ Object (readonly)
Returns the value of attribute global_hash.
30 31 32 |
# File 'lib/providers/bitly/response.rb', line 30 def global_hash @global_hash end |
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
30 31 32 |
# File 'lib/providers/bitly/response.rb', line 30 def hash @hash end |
#long_url ⇒ Object (readonly)
Returns the value of attribute long_url.
30 31 32 |
# File 'lib/providers/bitly/response.rb', line 30 def long_url @long_url end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
30 31 32 |
# File 'lib/providers/bitly/response.rb', line 30 def url @url end |
Instance Method Details
#parse ⇒ Object
Assuming format is always json for now.
33 34 35 36 37 |
# File 'lib/providers/bitly/response.rb', line 33 def parse @parsed_response = @parser.parse(@response) @url = @parsed_response["data"]["url"] @hash = @parsed_response["data"]["hash"] end |