Class: Pocket::Image
- Inherits:
-
Object
- Object
- Pocket::Image
- Defined in:
- lib/pocket/image.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
- #caption ⇒ Object
- #image_id ⇒ Object
-
#initialize(response) ⇒ Image
constructor
A new instance of Image.
- #src ⇒ Object
Constructor Details
#initialize(response) ⇒ Image
Returns a new instance of Image.
5 6 7 |
# File 'lib/pocket/image.rb', line 5 def initialize(response) @response = response end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
3 4 5 |
# File 'lib/pocket/image.rb', line 3 def response @response end |
Instance Method Details
#caption ⇒ Object
13 14 15 |
# File 'lib/pocket/image.rb', line 13 def caption response.fetch("caption") end |
#image_id ⇒ Object
17 18 19 |
# File 'lib/pocket/image.rb', line 17 def image_id Integer(response.fetch("image_id")) end |
#src ⇒ Object
9 10 11 |
# File 'lib/pocket/image.rb', line 9 def src response.fetch("src") end |