Class: Koko::Tracker::Response
- Inherits:
-
Object
- Object
- Koko::Tracker::Response
- Defined in:
- lib/koko/tracker/response.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status = 200, body = nil) ⇒ Response
constructor
public: Simple class to wrap responses from the API.
- #valid? ⇒ Boolean
Constructor Details
#initialize(status = 200, body = nil) ⇒ Response
public: Simple class to wrap responses from the API
9 10 11 12 |
# File 'lib/koko/tracker/response.rb', line 9 def initialize(status = 200, body = nil) @status = status @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
4 5 6 |
# File 'lib/koko/tracker/response.rb', line 4 def body @body end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/koko/tracker/response.rb', line 4 def status @status end |
Instance Method Details
#valid? ⇒ Boolean
14 15 16 |
# File 'lib/koko/tracker/response.rb', line 14 def valid? @status >= 200 && @status < 300 end |