Class: TMDBParty::Category

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values) ⇒ Category

Returns a new instance of Category.



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

def self.parse(data)
  return unless data
  data = data["category"]
  if data.is_a?(Array)
    data.collect do |category|
      Category.new(category)
    end
  else
    [Category.new(data)]
  end
end