Class: Snafu::Models::GlitchImage
- Inherits:
-
Object
- Object
- Snafu::Models::GlitchImage
- Defined in:
- lib/snafu/models/glitch_image.rb
Overview
Provides a simple class to represent image information returned by the Glitch API.
Instance Attribute Summary collapse
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ GlitchImage
constructor
Accepts an options hash with
:url
,:width
, and:height
properties.
Constructor Details
#initialize(options = {}) ⇒ GlitchImage
Accepts an options hash with :url
, :width
, and :height
properties
10 11 12 13 14 |
# File 'lib/snafu/models/glitch_image.rb', line 10 def initialize(={}) @url = [:url] @width = [:width].to_i || 0 @height = [:height].to_i || 0 end |
Instance Attribute Details
#height ⇒ Object (readonly)
Returns the value of attribute height.
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def height @height end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def url @url end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def width @width end |