Class: Seatsio::EventReport
- Inherits:
-
Object
- Object
- Seatsio::EventReport
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
Instance Method Summary collapse
-
#initialize(data) ⇒ EventReport
constructor
A new instance of EventReport.
Constructor Details
#initialize(data) ⇒ EventReport
Returns a new instance of EventReport.
303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 |
# File 'lib/seatsio/domain.rb', line 303 def initialize(data) if data.is_a? Array items = [] data.each do |item| items << EventReportItem.new(item) end @items = items elsif data.nil? @items = [] else items = {} data.each do |key, values| items[key] = [] values.each do |value| items[key] << EventReportItem.new(value) end end @items = items end end |
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
301 302 303 |
# File 'lib/seatsio/domain.rb', line 301 def items @items end |