Class: ProconBypassMan::DeviceConnection::OutputReportSubCommandTable::HIDSubCommandResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(sub_command:, sub_command_arg:) ⇒ HIDSubCommandResponse

Returns a new instance of HIDSubCommandResponse.



5
6
7
8
# File 'lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb', line 5

def initialize(sub_command: , sub_command_arg: )
  @sub_command = sub_command
  @sub_command_arg = sub_command_arg
end

Instance Attribute Details

#sub_commandObject

Returns the value of attribute sub_command.



3
4
5
# File 'lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb', line 3

def sub_command
  @sub_command
end

#sub_command_argObject

Returns the value of attribute sub_command_arg.



3
4
5
# File 'lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb', line 3

def sub_command_arg
  @sub_command_arg
end

Instance Method Details

#sub_command_with_argObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/procon_bypass_man/device_connection/output_report_sub_command_table.rb', line 10

def sub_command_with_arg
  case @sub_command
  when *SPECIAL_SUB_COMMANDS
    @sub_command
  else
    if @sub_command_arg
      "#{@sub_command}-#{@sub_command_arg}"
    else
      @sub_command
    end
  end
end