Class: MotionGiphy::Image
- Inherits:
-
Object
- Object
- MotionGiphy::Image
- Defined in:
- lib/motion-giphy/image.rb
Instance Attribute Summary collapse
-
#frames ⇒ Object
readonly
Returns the value of attribute frames.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#mp4 ⇒ Object
readonly
Returns the value of attribute mp4.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(image_hash) ⇒ Image
constructor
A new instance of Image.
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
#frames ⇒ Object (readonly)
Returns the value of attribute frames.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def frames @frames end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def height @height end |
#mp4 ⇒ Object (readonly)
Returns the value of attribute mp4.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def mp4 @mp4 end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def size @size end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
3 4 5 |
# File 'lib/motion-giphy/image.rb', line 3 def width @width end |