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.



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

def initialize(values)
  self.attributes = values
end

Class Method Details

.parse(data) ⇒ Object



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

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