Class: Seatsio::SocialDistancingRuleset
- Inherits:
-
Object
- Object
- Seatsio::SocialDistancingRuleset
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#disable_diagonal_seats_in_front_and_behind ⇒ Object
readonly
Returns the value of attribute disable_diagonal_seats_in_front_and_behind.
-
#disable_seats_in_front_and_behind ⇒ Object
readonly
Returns the value of attribute disable_seats_in_front_and_behind.
-
#disabled_seats ⇒ Object
readonly
Returns the value of attribute disabled_seats.
-
#enabled_seats ⇒ Object
readonly
Returns the value of attribute enabled_seats.
-
#fixed_group_layout ⇒ Object
readonly
Returns the value of attribute fixed_group_layout.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#max_group_size ⇒ Object
readonly
Returns the value of attribute max_group_size.
-
#max_occupancy_absolute ⇒ Object
readonly
Returns the value of attribute max_occupancy_absolute.
-
#max_occupancy_percentage ⇒ Object
readonly
Returns the value of attribute max_occupancy_percentage.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number_of_disabled_aisle_seats ⇒ Object
readonly
Returns the value of attribute number_of_disabled_aisle_seats.
-
#number_of_disabled_seats_to_the_sides ⇒ Object
readonly
Returns the value of attribute number_of_disabled_seats_to_the_sides.
-
#one_group_per_table ⇒ Object
readonly
Returns the value of attribute one_group_per_table.
Class Method Summary collapse
- .fixed(name, disabled_seats: [], index: 0) ⇒ Object
- .rule_based(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, disabled_seats: [], enabled_seats: [], index: 0) ⇒ Object
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, fixed_group_layout: false, disabled_seats: [], enabled_seats: [], index: 0) ⇒ SocialDistancingRuleset
constructor
A new instance of SocialDistancingRuleset.
Constructor Details
#initialize(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, fixed_group_layout: false, disabled_seats: [], enabled_seats: [], index: 0) ⇒ SocialDistancingRuleset
Returns a new instance of SocialDistancingRuleset.
521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 |
# File 'lib/seatsio/domain.rb', line 521 def initialize(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, fixed_group_layout: false, disabled_seats: [], enabled_seats: [], index: 0) @name = name @number_of_disabled_seats_to_the_sides = number_of_disabled_seats_to_the_sides @disable_seats_in_front_and_behind = disable_seats_in_front_and_behind @disable_diagonal_seats_in_front_and_behind = disable_diagonal_seats_in_front_and_behind @number_of_disabled_aisle_seats = number_of_disabled_aisle_seats @max_group_size = max_group_size @max_occupancy_absolute = max_occupancy_absolute @max_occupancy_percentage = max_occupancy_percentage @one_group_per_table = one_group_per_table @fixed_group_layout = fixed_group_layout @disabled_seats = disabled_seats @enabled_seats = enabled_seats @index = index end |
Instance Attribute Details
#disable_diagonal_seats_in_front_and_behind ⇒ Object (readonly)
Returns the value of attribute disable_diagonal_seats_in_front_and_behind.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def disable_diagonal_seats_in_front_and_behind @disable_diagonal_seats_in_front_and_behind end |
#disable_seats_in_front_and_behind ⇒ Object (readonly)
Returns the value of attribute disable_seats_in_front_and_behind.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def disable_seats_in_front_and_behind @disable_seats_in_front_and_behind end |
#disabled_seats ⇒ Object (readonly)
Returns the value of attribute disabled_seats.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def disabled_seats @disabled_seats end |
#enabled_seats ⇒ Object (readonly)
Returns the value of attribute enabled_seats.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def enabled_seats @enabled_seats end |
#fixed_group_layout ⇒ Object (readonly)
Returns the value of attribute fixed_group_layout.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def fixed_group_layout @fixed_group_layout end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def index @index end |
#max_group_size ⇒ Object (readonly)
Returns the value of attribute max_group_size.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def max_group_size @max_group_size end |
#max_occupancy_absolute ⇒ Object (readonly)
Returns the value of attribute max_occupancy_absolute.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def max_occupancy_absolute @max_occupancy_absolute end |
#max_occupancy_percentage ⇒ Object (readonly)
Returns the value of attribute max_occupancy_percentage.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def max_occupancy_percentage @max_occupancy_percentage end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def name @name end |
#number_of_disabled_aisle_seats ⇒ Object (readonly)
Returns the value of attribute number_of_disabled_aisle_seats.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def number_of_disabled_aisle_seats @number_of_disabled_aisle_seats end |
#number_of_disabled_seats_to_the_sides ⇒ Object (readonly)
Returns the value of attribute number_of_disabled_seats_to_the_sides.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def number_of_disabled_seats_to_the_sides @number_of_disabled_seats_to_the_sides end |
#one_group_per_table ⇒ Object (readonly)
Returns the value of attribute one_group_per_table.
517 518 519 |
# File 'lib/seatsio/domain.rb', line 517 def one_group_per_table @one_group_per_table end |
Class Method Details
.fixed(name, disabled_seats: [], index: 0) ⇒ Object
539 540 541 |
# File 'lib/seatsio/domain.rb', line 539 def self.fixed(name, disabled_seats: [], index: 0) return SocialDistancingRuleset.new(name, index: index, disabled_seats: disabled_seats, fixed_group_layout: true) end |
.rule_based(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, disabled_seats: [], enabled_seats: [], index: 0) ⇒ Object
543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 |
# File 'lib/seatsio/domain.rb', line 543 def self.rule_based(name, number_of_disabled_seats_to_the_sides: 0, disable_seats_in_front_and_behind: false, disable_diagonal_seats_in_front_and_behind: false, number_of_disabled_aisle_seats: 0, max_group_size: 0, max_occupancy_absolute: 0, max_occupancy_percentage: 0, one_group_per_table: false, disabled_seats: [], enabled_seats: [], index: 0) return SocialDistancingRuleset.new(name, number_of_disabled_seats_to_the_sides: number_of_disabled_seats_to_the_sides, disable_seats_in_front_and_behind: disable_seats_in_front_and_behind, disable_diagonal_seats_in_front_and_behind: disable_diagonal_seats_in_front_and_behind, number_of_disabled_aisle_seats: number_of_disabled_aisle_seats, max_group_size: max_group_size, max_occupancy_absolute: max_occupancy_absolute, max_occupancy_percentage: max_occupancy_percentage, one_group_per_table: one_group_per_table, fixed_group_layout: false, disabled_seats: disabled_seats, enabled_seats: enabled_seats, index: index) end |
Instance Method Details
#==(other) ⇒ Object
561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 |
# File 'lib/seatsio/domain.rb', line 561 def == (other) self.name == other.name && self.number_of_disabled_seats_to_the_sides == other.number_of_disabled_seats_to_the_sides && self.disable_seats_in_front_and_behind == other.disable_seats_in_front_and_behind && self.disable_diagonal_seats_in_front_and_behind == other.disable_diagonal_seats_in_front_and_behind && self.number_of_disabled_aisle_seats == other.number_of_disabled_aisle_seats && self.max_group_size == other.max_group_size && self.max_occupancy_absolute == other.max_occupancy_absolute && self.max_occupancy_percentage == other.max_occupancy_percentage && self.one_group_per_table == other.one_group_per_table && self.fixed_group_layout == other.fixed_group_layout && self.disabled_seats == other.disabled_seats && self.enabled_seats == other.enabled_seats && self.index == other.index end |