Class: TMDBParty::Person

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values) ⇒ Person

Returns a new instance of Person.



6
7
8
# File 'lib/tmdb_party/person.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/person.rb', line 10

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