Class: Smartware::SankyoConnection::CommandResponse
- Inherits:
-
Object
- Object
- Smartware::SankyoConnection::CommandResponse
- Defined in:
- lib/smartware/drivers/common/sankyo_connection.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ CommandResponse
constructor
A new instance of CommandResponse.
- #negative? ⇒ Boolean
- #positive? ⇒ Boolean
- #response ⇒ Object
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
15 16 17 |
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 15 def negative? @response[0] != "P" end |
#positive? ⇒ Boolean
11 12 13 |
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 11 def positive? @response[0] == "P" end |
#response ⇒ Object
19 20 21 |
# File 'lib/smartware/drivers/common/sankyo_connection.rb', line 19 def response @response[1..-1] end |