Class: Seatsio::Zone
- Inherits:
-
Object
- Object
- Seatsio::Zone
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Class Method Summary collapse
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(key, label) ⇒ Zone
constructor
A new instance of Zone.
Constructor Details
#initialize(key, label) ⇒ Zone
Returns a new instance of Zone.
33 34 35 36 |
# File 'lib/seatsio/domain.rb', line 33 def initialize(key, label) @key = key @label = label end |
Instance Attribute Details
#key ⇒ Object (readonly)
Returns the value of attribute key.
31 32 33 |
# File 'lib/seatsio/domain.rb', line 31 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
31 32 33 |
# File 'lib/seatsio/domain.rb', line 31 def label @label end |
Class Method Details
.create_list(list = []) ⇒ Object
49 50 51 52 53 54 55 56 57 |
# File 'lib/seatsio/domain.rb', line 49 def self.create_list(list = []) result = [] list.each do |item| result << Zone.from_json(item) end result end |
.from_json(data) ⇒ Object
38 39 40 41 42 |
# File 'lib/seatsio/domain.rb', line 38 def self.from_json(data) if data Zone.new(data['key'], data['label']) end end |
Instance Method Details
#==(other) ⇒ Object
44 45 46 47 |
# File 'lib/seatsio/domain.rb', line 44 def == (other) key == other.key && label == other.label end |