Class: Seatsio::EventReport

Inherits:
Object
  • Object
show all
Defined in:
lib/seatsio/domain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ EventReport

Returns a new instance of EventReport.



396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
# File 'lib/seatsio/domain.rb', line 396

def initialize(data)
  if data.is_a? Array
    items = []
    data.each do |item|
      items << EventObjectInfo.new(item)
    end
    @items = items
  elsif data.nil?
    @items = []
  else
    items = {}
    data.each do |key, values|
      items[key] = []
      values.each do |value|
        items[key] << EventObjectInfo.new(value)
      end
    end
    @items = items
  end
end

Instance Attribute Details

#itemsObject (readonly)

Returns the value of attribute items.



394
395
396
# File 'lib/seatsio/domain.rb', line 394

def items
  @items
end