Class: TMDBParty::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/tmdb_party/image.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Image

Returns a new instance of Image.



5
6
7
8
9
# File 'lib/tmdb_party/image.rb', line 5

def initialize(options={})
  @url = options["url"]
  @type = options["type"]
  @size = options["size"]
end

Instance Attribute Details

#sizeObject (readonly)

Returns the value of attribute size.



3
4
5
# File 'lib/tmdb_party/image.rb', line 3

def size
  @size
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/tmdb_party/image.rb', line 3

def type
  @type
end

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/tmdb_party/image.rb', line 3

def url
  @url
end

Class Method Details

.parse(data) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/tmdb_party/image.rb', line 11

def self.parse(data)
  puts data.inspect
  puts
  puts
  if data.is_a?(Array)
    data.collect do |image|
      Image.new(image["image"])
    end
  else
    Image.new(image["image"])
  end
end