Class: Sanford::Protocol::ResponseStatus
- Inherits:
-
Struct
- Object
- Struct
- Sanford::Protocol::ResponseStatus
- Defined in:
- lib/sanford-protocol/response_status.rb
Defined Under Namespace
Classes: Code
Instance Attribute Summary collapse
-
#code_obj ⇒ Object
Returns the value of attribute code_obj.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
- #code ⇒ Object (also: #to_i)
- #code=(new_code) ⇒ Object
-
#initialize(code, message = nil) ⇒ ResponseStatus
constructor
A new instance of ResponseStatus.
- #inspect ⇒ Object
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(code, message = nil) ⇒ ResponseStatus
Returns a new instance of ResponseStatus.
9 10 11 |
# File 'lib/sanford-protocol/response_status.rb', line 9 def initialize(code, = nil) super(Code.new(code), ) end |
Instance Attribute Details
#code_obj ⇒ Object
Returns the value of attribute code_obj
7 8 9 |
# File 'lib/sanford-protocol/response_status.rb', line 7 def code_obj @code_obj end |
#message ⇒ Object
Returns the value of attribute message
7 8 9 |
# File 'lib/sanford-protocol/response_status.rb', line 7 def @message end |
Instance Method Details
#code ⇒ Object Also known as: to_i
13 |
# File 'lib/sanford-protocol/response_status.rb', line 13 def code; self.code_obj.number; end |
#code=(new_code) ⇒ Object
16 17 18 |
# File 'lib/sanford-protocol/response_status.rb', line 16 def code=(new_code) self.code_obj = Code.new(new_code) end |
#inspect ⇒ Object
23 24 25 26 |
# File 'lib/sanford-protocol/response_status.rb', line 23 def inspect reference = '0x0%x' % (self.object_id << 1) "#<#{self.class}:#{reference} @code=#{code_obj} @message=#{.inspect}>" end |
#name ⇒ Object
20 |
# File 'lib/sanford-protocol/response_status.rb', line 20 def name; code_obj.name; end |
#to_s ⇒ Object
21 |
# File 'lib/sanford-protocol/response_status.rb', line 21 def to_s; code_obj.to_s; end |