Class: Roark::Response
- Inherits:
-
Object
- Object
- Roark::Response
- Defined in:
- lib/roark/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(args = {}) ⇒ Response
Returns a new instance of Response.
5 6 7 8 |
# File 'lib/roark/response.rb', line 5 def initialize(args={}) @code = args.fetch :code, 1 @message = args.fetch :message, '' end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
3 4 5 |
# File 'lib/roark/response.rb', line 3 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/roark/response.rb', line 3 def @message end |
Instance Method Details
#success? ⇒ Boolean
10 11 12 |
# File 'lib/roark/response.rb', line 10 def success? @code == 0 end |