Class: Badline::Status
- Inherits:
-
Object
- Object
- Badline::Status
- Defined in:
- lib/badline/status.rb
Instance Attribute Summary collapse
-
#bitmask ⇒ Object
readonly
Returns the value of attribute bitmask.
-
#flags ⇒ Object
readonly
Returns the value of attribute flags.
-
#high_mask ⇒ Object
readonly
Returns the value of attribute high_mask.
-
#low_mask ⇒ Object
readonly
Returns the value of attribute low_mask.
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
-
#initialize(flags = [], value: 0x0) ⇒ Status
constructor
A new instance of Status.
Constructor Details
#initialize(flags = [], value: 0x0) ⇒ Status
Returns a new instance of Status.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/badline/status.rb', line 7 def initialize(flags = [], value: 0x0) @flags = flags @bitmask = create_mask { |f| f.is_a?(Symbol) } @low_mask = create_mask { |f| f.is_a?(Integer) && f.zero? } @high_mask = create_mask { |f| f.is_a?(Integer) && f == 1 } self.value = value define_accessors! end |
Instance Attribute Details
#bitmask ⇒ Object (readonly)
Returns the value of attribute bitmask.
5 6 7 |
# File 'lib/badline/status.rb', line 5 def bitmask @bitmask end |
#flags ⇒ Object (readonly)
Returns the value of attribute flags.
5 6 7 |
# File 'lib/badline/status.rb', line 5 def flags @flags end |
#high_mask ⇒ Object (readonly)
Returns the value of attribute high_mask.
5 6 7 |
# File 'lib/badline/status.rb', line 5 def high_mask @high_mask end |
#low_mask ⇒ Object (readonly)
Returns the value of attribute low_mask.
5 6 7 |
# File 'lib/badline/status.rb', line 5 def low_mask @low_mask end |
#value ⇒ Object
Returns the value of attribute value.
5 6 7 |
# File 'lib/badline/status.rb', line 5 def value @value end |