Class: Smartware::SankyoConnection::CommandResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/smartware/drivers/common/sankyo_connection.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ CommandResponse

Returns a new instance of CommandResponse.



7
8
9
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 7

def initialize(response)
  @response = response
end

Instance Method Details

#negative?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 15

def negative?
  @response[0] != "P"
end

#positive?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 11

def positive?
  @response[0] == "P"
end

#responseObject



19
20
21
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 19

def response
  @response[1..-1]
end