Class: Response
- Inherits:
-
Object
- Object
- Response
- Defined in:
- lib/bstat2google/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #equal?(other) ⇒ Boolean
-
#initialize(attrs = {}) ⇒ Response
constructor
A new instance of Response.
- #successful? ⇒ Boolean
Constructor Details
#initialize(attrs = {}) ⇒ Response
Returns a new instance of Response.
3 4 5 |
# File 'lib/bstat2google/response.rb', line 3 def initialize(attrs = {}) attrs.each {|k,v| self.send("#{k}=", v)} end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
2 3 4 |
# File 'lib/bstat2google/response.rb', line 2 def code @code end |
#payload ⇒ Object
Returns the value of attribute payload.
2 3 4 |
# File 'lib/bstat2google/response.rb', line 2 def payload @payload end |
Instance Method Details
#equal?(other) ⇒ Boolean
9 10 11 |
# File 'lib/bstat2google/response.rb', line 9 def equal?(other) !other.nil? && code.equal?(other.code) && payload.equal?(other.payload) end |
#successful? ⇒ Boolean
6 7 8 |
# File 'lib/bstat2google/response.rb', line 6 def successful? code >= 200 and code < 300 end |