module ProconBypassMan::Procon::PushedButtonHelper::Static

Public Instance Methods

pressed_button?(button) click to toggle source
# File lib/procon_bypass_man/procon/pressed_button_helper.rb, line 3
def pressed_button?(button)
  binary[
    ::ProconBypassMan::Procon::ButtonCollection.load(button).byte_position
  ].unpack("H*").first.to_i(16).to_s(2).reverse[
    ::ProconBypassMan::Procon::ButtonCollection.load(button).bit_position
  ] == '1'
end