Class: Lino::Model::Flag
- Inherits:
-
Object
- Object
- Lino::Model::Flag
- Defined in:
- lib/lino/model/flag.rb
Instance Attribute Summary collapse
-
#flag ⇒ Object
readonly
Returns the value of attribute flag.
-
#placement ⇒ Object
readonly
Returns the value of attribute placement.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #array ⇒ Object
- #hash ⇒ Object
-
#initialize(flag, opts = {}) ⇒ Flag
constructor
A new instance of Flag.
- #string ⇒ Object (also: #to_s, #to_a)
Constructor Details
#initialize(flag, opts = {}) ⇒ Flag
Returns a new instance of Flag.
9 10 11 12 13 |
# File 'lib/lino/model/flag.rb', line 9 def initialize(flag, opts = {}) opts = with_defaults(opts) @flag = flag @placement = opts[:placement] end |
Instance Attribute Details
#flag ⇒ Object (readonly)
Returns the value of attribute flag.
6 7 8 |
# File 'lib/lino/model/flag.rb', line 6 def flag @flag end |
#placement ⇒ Object (readonly)
Returns the value of attribute placement.
6 7 8 |
# File 'lib/lino/model/flag.rb', line 6 def placement @placement end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
25 26 27 28 |
# File 'lib/lino/model/flag.rb', line 25 def ==(other) self.class == other.class && state == other.state end |
#array ⇒ Object
20 21 22 |
# File 'lib/lino/model/flag.rb', line 20 def array [flag.to_s] end |
#hash ⇒ Object
31 32 33 |
# File 'lib/lino/model/flag.rb', line 31 def hash [self.class, state].hash end |
#string ⇒ Object Also known as: to_s, to_a
15 16 17 |
# File 'lib/lino/model/flag.rb', line 15 def string flag.to_s end |