Sha256: 3f497e7b5d7095d0e7e3d869bf1fe60525b3a3e5f047c1391450383c4d925821
Contents?: true
Size: 383 Bytes
Versions: 29
Compression:
Stored size: 383 Bytes
Contents
class ProconBypassMan::PressButtonAware BIT_ON = '1'.freeze def initialize(binary) @binary = binary end # @param [Symbol] # @return [Boolean] def pressing_button?(button) button_obj = ProconBypassMan::Procon::Button.new(button) byte = @binary[button_obj.byte_position].unpack("C").first.to_s(2).reverse byte[button_obj.bit_position] == BIT_ON end end
Version data entries
29 entries across 29 versions & 1 rubygems