Class: TMDBParty::Genre

Inherits:
Object
  • Object
show all
Includes:
Attributes
Defined in:
lib/tmdb_party/genre.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values) ⇒ Genre

Returns a new instance of Genre.



6
7
8
# File 'lib/tmdb_party/genre.rb', line 6

def initialize(values)
  self.attributes = values
end

Class Method Details

.parse(data) ⇒ Object



10
11
12
13
14
15
16
17
18
19
# File 'lib/tmdb_party/genre.rb', line 10

def self.parse(data)
  return unless data
  if data.is_a?(Array)
    data.collect do |g|
      Genre.new(g)
    end
  else
    [Genre.new(data)]
  end
end