Class: Seatsio::Category
- Inherits:
-
Object
- Object
- Seatsio::Category
- Defined in:
- lib/seatsio/domain.rb
Instance Attribute Summary collapse
-
#accessible ⇒ Object
readonly
Returns the value of attribute accessible.
-
#color ⇒ Object
readonly
Returns the value of attribute color.
-
#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, color, accessible = false) ⇒ Category
constructor
A new instance of Category.
Constructor Details
#initialize(key, label, color, accessible = false) ⇒ Category
Returns a new instance of Category.
75 76 77 78 79 80 |
# File 'lib/seatsio/domain.rb', line 75 def initialize(key, label, color, accessible = false) @key = key @label = label @color = color @accessible = accessible end |
Instance Attribute Details
#accessible ⇒ Object (readonly)
Returns the value of attribute accessible.
73 74 75 |
# File 'lib/seatsio/domain.rb', line 73 def accessible @accessible end |
#color ⇒ Object (readonly)
Returns the value of attribute color.
73 74 75 |
# File 'lib/seatsio/domain.rb', line 73 def color @color end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
73 74 75 |
# File 'lib/seatsio/domain.rb', line 73 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
73 74 75 |
# File 'lib/seatsio/domain.rb', line 73 def label @label end |
Class Method Details
.create_list(list = []) ⇒ Object
88 89 90 91 92 93 94 95 96 |
# File 'lib/seatsio/domain.rb', line 88 def self.create_list(list = []) result = [] list.each do |item| result << Category.from_json(item) end result end |
.from_json(data) ⇒ Object
82 83 84 85 86 |
# File 'lib/seatsio/domain.rb', line 82 def self.from_json(data) if data Category.new(data['key'], data['label'], data['color'], data['accessible']) end end |
Instance Method Details
#==(other) ⇒ Object
98 99 100 101 102 103 |
# File 'lib/seatsio/domain.rb', line 98 def == (other) key == other.key && label == other.label && color == other.color && accessible == other.accessible end |