Class: OStatus2::SubscriptionResponse
- Inherits:
-
Object
- Object
- OStatus2::SubscriptionResponse
- Defined in:
- lib/ostatus2/subscription_response.rb
Instance Method Summary collapse
-
#failed? ⇒ Boolean
Was the hub operation not successful?.
-
#initialize(code, body) ⇒ SubscriptionResponse
constructor
A new instance of SubscriptionResponse.
-
#message ⇒ String
Returns error message if the operation was not successful.
-
#successful? ⇒ Boolean
Was the hub operation successful?.
Constructor Details
#initialize(code, body) ⇒ SubscriptionResponse
Returns a new instance of SubscriptionResponse.
5 6 7 8 |
# File 'lib/ostatus2/subscription_response.rb', line 5 def initialize(code, body) @code = code @body = body end |
Instance Method Details
#failed? ⇒ Boolean
Was the hub operation not successful?
18 19 20 |
# File 'lib/ostatus2/subscription_response.rb', line 18 def failed? !successful? end |
#message ⇒ String
Returns error message if the operation was not successful
24 25 26 |
# File 'lib/ostatus2/subscription_response.rb', line 24 def @body end |
#successful? ⇒ Boolean
Was the hub operation successful?
12 13 14 |
# File 'lib/ostatus2/subscription_response.rb', line 12 def successful? @code == 202 end |