Class: ProconBypassMan::Procon::Button
- Inherits:
-
Object
- Object
- ProconBypassMan::Procon::Button
- Defined in:
- lib/procon_bypass_man/procon/button.rb
Defined Under Namespace
Classes: UnknownButtonFoundError
Instance Attribute Summary collapse
-
#bit_position ⇒ Object
Returns the value of attribute bit_position.
-
#byte_position ⇒ Object
Returns the value of attribute byte_position.
Instance Method Summary collapse
-
#initialize(key) ⇒ Button
constructor
A new instance of Button.
Constructor Details
#initialize(key) ⇒ Button
Returns a new instance of Button.
6 7 8 9 10 |
# File 'lib/procon_bypass_man/procon/button.rb', line 6 def initialize(key) b = ProconBypassMan::Procon::ButtonCollection::BUTTONS_MAP[key] or raise(UnknownButtonFoundError, "#{key}は定義にないボタンです") self.byte_position = b[:byte_position] self.bit_position = b[:bit_position] end |
Instance Attribute Details
#bit_position ⇒ Object
Returns the value of attribute bit_position.
4 5 6 |
# File 'lib/procon_bypass_man/procon/button.rb', line 4 def bit_position @bit_position end |
#byte_position ⇒ Object
Returns the value of attribute byte_position.
4 5 6 |
# File 'lib/procon_bypass_man/procon/button.rb', line 4 def byte_position @byte_position end |