Class: Seatsio::TableBookingConfig

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(mode, tables = nil) ⇒ TableBookingConfig

Returns a new instance of TableBookingConfig.



143
144
145
146
# File 'lib/seatsio/domain.rb', line 143

def initialize(mode, tables = nil)
  @mode = mode
  @tables = tables
end

Instance Attribute Details

#modeObject (readonly)

Returns the value of attribute mode.



141
142
143
# File 'lib/seatsio/domain.rb', line 141

def mode
  @mode
end

#tablesObject (readonly)

Returns the value of attribute tables.



141
142
143
# File 'lib/seatsio/domain.rb', line 141

def tables
  @tables
end

Class Method Details

.all_by_seatObject



152
153
154
# File 'lib/seatsio/domain.rb', line 152

def self.all_by_seat
  TableBookingConfig.new('ALL_BY_SEAT')
end

.all_by_tableObject



156
157
158
# File 'lib/seatsio/domain.rb', line 156

def self.all_by_table
  TableBookingConfig.new('ALL_BY_TABLE')
end

.custom(tables) ⇒ Object



160
161
162
# File 'lib/seatsio/domain.rb', line 160

def self.custom(tables)
  TableBookingConfig.new('CUSTOM', tables)
end

.from_json(data) ⇒ Object



164
165
166
167
168
# File 'lib/seatsio/domain.rb', line 164

def self.from_json(data)
  if data
    TableBookingConfig.new(data['mode'], data['tables'])
  end
end

.inheritObject



148
149
150
# File 'lib/seatsio/domain.rb', line 148

def self.inherit
  TableBookingConfig.new('INHERIT')
end