Sha256: 6f7284c744e28de1faef73d9128717982584d9fdb0f53dcf6ef8d006067de1cd

Contents?: true

Size: 605 Bytes

Versions: 3

Compression:

Stored size: 605 Bytes

Contents

class OutputReportGenerator
  NO_ACTION = ["30f28100800078c77448287509550274ff131029001b0022005a0271ff191028001e00210064027cff1410280020002100000000000000000000000000000000"].pack("H*").freeze

  # @param [Array<Symbol, String>, NilClass] pressed_buttons
  def initialize(*pressed_buttons)
    @buttons = pressed_buttons || []
  end

  # @return [String]
  def execute
    user_operation = ProconBypassMan::Procon::UserOperation.new(NO_ACTION.dup)
    [@buttons].flatten.sort.uniq.each do |button|
      user_operation.press_button(button.to_sym)
    end

    user_operation.binary.unpack.first
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/support/output_report_generator.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/support/output_report_generator.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/support/output_report_generator.rb