Class: Seatsio::Domain::Event
- Inherits:
-
Object
- Object
- Seatsio::Domain::Event
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#book_whole_tables ⇒ Object
Returns the value of attribute book_whole_tables.
-
#channels ⇒ Object
Returns the value of attribute channels.
-
#chart_key ⇒ Object
Returns the value of attribute chart_key.
-
#created_on ⇒ Object
Returns the value of attribute created_on.
-
#for_sale_config ⇒ Object
Returns the value of attribute for_sale_config.
-
#id ⇒ Object
Returns the value of attribute id.
-
#key ⇒ Object
Returns the value of attribute key.
-
#social_distancing_ruleset_key ⇒ Object
Returns the value of attribute social_distancing_ruleset_key.
-
#supports_best_available ⇒ Object
Returns the value of attribute supports_best_available.
-
#table_booking_modes ⇒ Object
Returns the value of attribute table_booking_modes.
-
#updated_on ⇒ Object
Returns the value of attribute updated_on.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(data) ⇒ Event
constructor
A new instance of Event.
Constructor Details
#initialize(data) ⇒ Event
Returns a new instance of Event.
90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/seatsio/domain.rb', line 90 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']) @channels = data['channels'].map { |d| Channel.new(d['key'], d['name'], d['color'], d['index'], d['objects']) } if data['channels'] = data['socialDistancingRulesetKey'] end |
Instance Attribute Details
#book_whole_tables ⇒ Object
Returns the value of attribute book_whole_tables.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def book_whole_tables @book_whole_tables end |
#channels ⇒ Object
Returns the value of attribute channels.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def channels @channels end |
#chart_key ⇒ Object
Returns the value of attribute chart_key.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def chart_key @chart_key end |
#created_on ⇒ Object
Returns the value of attribute created_on.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def created_on @created_on end |
#for_sale_config ⇒ Object
Returns the value of attribute for_sale_config.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def for_sale_config @for_sale_config end |
#id ⇒ Object
Returns the value of attribute id.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def id @id end |
#key ⇒ Object
Returns the value of attribute key.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def key @key end |
#social_distancing_ruleset_key ⇒ Object
Returns the value of attribute social_distancing_ruleset_key.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def end |
#supports_best_available ⇒ Object
Returns the value of attribute supports_best_available.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def supports_best_available @supports_best_available end |
#table_booking_modes ⇒ Object
Returns the value of attribute table_booking_modes.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def table_booking_modes @table_booking_modes end |
#updated_on ⇒ Object
Returns the value of attribute updated_on.
86 87 88 |
# File 'lib/seatsio/domain.rb', line 86 def updated_on @updated_on end |
Class Method Details
.create_list(list = []) ⇒ Object
106 107 108 109 110 111 112 113 114 |
# File 'lib/seatsio/domain.rb', line 106 def self.create_list(list = []) result = [] list.each do |item| result << Event.new(item) end return result end |