Class: Tarpon::Response
- Inherits:
-
Object
- Object
- Tarpon::Response
- Defined in:
- lib/tarpon/response.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
-
#subscriber ⇒ Object
readonly
Returns the value of attribute subscriber.
Instance Method Summary collapse
-
#initialize(status, attributes) ⇒ Response
constructor
A new instance of Response.
- #message ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize(status, attributes) ⇒ Response
Returns a new instance of Response.
7 8 9 10 11 |
# File 'lib/tarpon/response.rb', line 7 def initialize(status, attributes) @status = status @raw = attributes @subscriber = @raw[:subscriber] && Entity::Subscriber.new(@raw[:subscriber]) end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/tarpon/response.rb', line 5 def raw @raw end |
#subscriber ⇒ Object (readonly)
Returns the value of attribute subscriber.
5 6 7 |
# File 'lib/tarpon/response.rb', line 5 def subscriber @subscriber end |
Instance Method Details
#message ⇒ Object
13 14 15 |
# File 'lib/tarpon/response.rb', line 13 def @raw[:message] end |
#success? ⇒ Boolean
17 18 19 |
# File 'lib/tarpon/response.rb', line 17 def success? @status.success? end |