class Grocer::ErrorResponse
Constants
- COMMAND
- STATUS_CODE_DESCRIPTIONS
Attributes
identifier[RW]
status_code[RW]
Public Class Methods
new(binary_tuple)
click to toggle source
# File lib/grocer/error_response.rb, line 20 def initialize(binary_tuple) # C => 1 byte command # C => 1 byte status # N => 4 byte identifier command, @status_code, @identifier = binary_tuple.unpack('CCN') raise InvalidFormatError unless @status_code && @identifier raise InvalidCommandError unless command == COMMAND end
Public Instance Methods
status()
click to toggle source
# File lib/grocer/error_response.rb, line 29 def status STATUS_CODE_DESCRIPTIONS[status_code] end