Class: CMUX::ModemCommandResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/cmux/modem_command_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, body) ⇒ ModemCommandResponse

Returns a new instance of ModemCommandResponse.



5
6
7
8
# File 'lib/cmux/modem_command_response.rb', line 5

def initialize(error, body)
  @error = error
  @response = body
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



3
4
5
# File 'lib/cmux/modem_command_response.rb', line 3

def error
  @error
end

#responseObject (readonly)

Returns the value of attribute response.



3
4
5
# File 'lib/cmux/modem_command_response.rb', line 3

def response
  @response
end

Instance Method Details

#failure?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/cmux/modem_command_response.rb', line 14

def failure?
  !success?
end

#success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/cmux/modem_command_response.rb', line 10

def success?
  @error.nil?
end