Class: Snafu::Models::GlitchImage

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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(options={})
  @url = options[:url]
  @width = options[:width].to_i || 0
  @height = options[:height].to_i || 0
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



7
8
9
# File 'lib/snafu/models/glitch_image.rb', line 7

def height
  @height
end

#urlObject (readonly)

Returns the value of attribute url.



7
8
9
# File 'lib/snafu/models/glitch_image.rb', line 7

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



7
8
9
# File 'lib/snafu/models/glitch_image.rb', line 7

def width
  @width
end