Class: MotionGiphy::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/motion-giphy/image.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(image_hash) ⇒ Image

Returns a new instance of Image.



5
6
7
8
9
10
11
12
# File 'lib/motion-giphy/image.rb', line 5

def initialize(image_hash)
  @url = image_hash["url"]
  @width = image_hash["width"].to_i
  @height = image_hash["height"].to_i
  @frames = image_hash["frames"].to_i
  @size = image_hash["size"].to_i
  @mp4 = image_hash["mp4"]
end

Instance Attribute Details

#framesObject (readonly)

Returns the value of attribute frames.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def frames
  @frames
end

#heightObject (readonly)

Returns the value of attribute height.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def height
  @height
end

#mp4Object (readonly)

Returns the value of attribute mp4.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def mp4
  @mp4
end

#sizeObject (readonly)

Returns the value of attribute size.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def size
  @size
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



3
4
5
# File 'lib/motion-giphy/image.rb', line 3

def width
  @width
end