Class: Giphy::Image
- Inherits:
-
Object
- Object
- Giphy::Image
- Defined in:
- lib/giphy/image.rb
Instance Method Summary collapse
- #frames ⇒ Object
- #height ⇒ Object
-
#initialize(hash) ⇒ Image
constructor
A new instance of Image.
- #size ⇒ Object
- #url ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(hash) ⇒ Image
Returns a new instance of Image.
3 4 5 |
# File 'lib/giphy/image.rb', line 3 def initialize(hash) @hash = hash end |
Instance Method Details
#frames ⇒ Object
23 24 25 |
# File 'lib/giphy/image.rb', line 23 def frames hash.fetch('frames', 0).to_i end |
#height ⇒ Object
15 16 17 |
# File 'lib/giphy/image.rb', line 15 def height hash.fetch('height').to_i end |
#size ⇒ Object
19 20 21 |
# File 'lib/giphy/image.rb', line 19 def size hash.fetch('size', 0).to_i end |
#url ⇒ Object
7 8 9 |
# File 'lib/giphy/image.rb', line 7 def url URI(hash.fetch('url')) end |
#width ⇒ Object
11 12 13 |
# File 'lib/giphy/image.rb', line 11 def width hash.fetch('width').to_i end |