Class: ProconBypassMan::Procon::Button

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/procon/button.rb

Defined Under Namespace

Classes: UnknownButtonFoundError

Instance Attribute Summary collapse

Instance Method Summary collapse

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_positionObject

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_positionObject

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