Class: GiantBomb::Publisher

Inherits:
Object show all
Includes:
Attributes
Defined in:
lib/giant_bomb/publisher.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Attributes

included

Constructor Details

#initialize(values) ⇒ Publisher

Returns a new instance of Publisher.



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

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