Class: Pocket::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/pocket/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/pocket/image.rb', line 3

def response
  @response
end

Instance Method Details

#captionObject



13
14
15
# File 'lib/pocket/image.rb', line 13

def caption
  response.fetch("caption")
end

#image_idObject



17
18
19
# File 'lib/pocket/image.rb', line 17

def image_id
  Integer(response.fetch("image_id"))
end

#srcObject



9
10
11
# File 'lib/pocket/image.rb', line 9

def src
  response.fetch("src")
end