Class: Seatsio::TableBookingConfig
- Inherits:
-
Object
- Object
- Seatsio::TableBookingConfig
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#tables ⇒ Object
readonly
Returns the value of attribute tables.
Class Method Summary collapse
- .all_by_seat ⇒ Object
- .all_by_table ⇒ Object
- .custom(tables) ⇒ Object
- .from_json(data) ⇒ Object
- .inherit ⇒ Object
Instance Method Summary collapse
-
#initialize(mode, tables = nil) ⇒ TableBookingConfig
constructor
A new instance of TableBookingConfig.
Constructor Details
#initialize(mode, tables = nil) ⇒ TableBookingConfig
Returns a new instance of TableBookingConfig.
113 114 115 116 |
# File 'lib/seatsio/domain.rb', line 113 def initialize(mode, tables = nil) @mode = mode @tables = tables end |
Instance Attribute Details
#mode ⇒ Object (readonly)
Returns the value of attribute mode.
111 112 113 |
# File 'lib/seatsio/domain.rb', line 111 def mode @mode end |
#tables ⇒ Object (readonly)
Returns the value of attribute tables.
111 112 113 |
# File 'lib/seatsio/domain.rb', line 111 def tables @tables end |
Class Method Details
.all_by_seat ⇒ Object
122 123 124 |
# File 'lib/seatsio/domain.rb', line 122 def self.all_by_seat TableBookingConfig.new('ALL_BY_SEAT') end |
.all_by_table ⇒ Object
126 127 128 |
# File 'lib/seatsio/domain.rb', line 126 def self.all_by_table TableBookingConfig.new('ALL_BY_TABLE') end |
.custom(tables) ⇒ Object
130 131 132 |
# File 'lib/seatsio/domain.rb', line 130 def self.custom(tables) TableBookingConfig.new('CUSTOM', tables) end |
.from_json(data) ⇒ Object
134 135 136 137 138 |
# File 'lib/seatsio/domain.rb', line 134 def self.from_json(data) if data TableBookingConfig.new(data['mode'], data['tables']) end end |
.inherit ⇒ Object
118 119 120 |
# File 'lib/seatsio/domain.rb', line 118 def self.inherit TableBookingConfig.new('INHERIT') end |