Class: Seatsio::Domain::Event

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Event

Returns a new instance of Event.



79
80
81
82
83
84
85
86
87
88
89
# File 'lib/seatsio/domain.rb', line 79

def initialize(data)
  @id = data['id']
  @key = data['key']
  @chart_key = data['chartKey']
  @book_whole_tables = data['bookWholeTables']
  @supports_best_available = data['supportsBestAvailable']
  @table_booking_modes = data['tableBookingModes']
  @for_sale_config = ForSaleConfig.new(data['forSaleConfig']) if data['forSaleConfig']
  @created_on = parse_date(data['createdOn'])
  @updated_on = parse_date(data['updatedOn'])
end

Instance Attribute Details

#book_whole_tablesObject

Returns the value of attribute book_whole_tables.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def book_whole_tables
  @book_whole_tables
end

#chart_keyObject

Returns the value of attribute chart_key.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def chart_key
  @chart_key
end

#created_onObject

Returns the value of attribute created_on.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def created_on
  @created_on
end

#for_sale_configObject

Returns the value of attribute for_sale_config.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def for_sale_config
  @for_sale_config
end

#idObject

Returns the value of attribute id.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def id
  @id
end

#keyObject

Returns the value of attribute key.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def key
  @key
end

#supports_best_availableObject

Returns the value of attribute supports_best_available.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def supports_best_available
  @supports_best_available
end

#table_booking_modesObject

Returns the value of attribute table_booking_modes.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def table_booking_modes
  @table_booking_modes
end

#updated_onObject

Returns the value of attribute updated_on.



76
77
78
# File 'lib/seatsio/domain.rb', line 76

def updated_on
  @updated_on
end

Class Method Details

.create_list(list = []) ⇒ Object



91
92
93
94
95
96
97
98
99
# File 'lib/seatsio/domain.rb', line 91

def self.create_list(list = [])
  result = []

  list.each do |item|
    result << Event.new(item)
  end

  return result
end