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)
-
- (Object) height
readonly
Returns the value of attribute height.
-
- (Object) url
readonly
Returns the value of attribute url.
-
- (Object) width
readonly
Returns the value of attribute width.
Instance Method Summary (collapse)
-
- (GlitchImage) initialize(options = {})
constructor
Accepts an options hash with :url, :width, and :height properties.
Constructor Details
- (GlitchImage) initialize(options = {})
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
- (Object) height (readonly)
Returns the value of attribute height
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def height @height end |
- (Object) url (readonly)
Returns the value of attribute url
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def url @url end |
- (Object) width (readonly)
Returns the value of attribute width
7 8 9 |
# File 'lib/snafu/models/glitch_image.rb', line 7 def width @width end |