Class: PusherPlatform::ErrorBody
- Inherits:
-
Object
- Object
- PusherPlatform::ErrorBody
- Defined in:
- lib/pusher-platform/common.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#error_description ⇒ Object
readonly
Returns the value of attribute error_description.
-
#error_uri ⇒ Object
readonly
Returns the value of attribute error_uri.
Instance Method Summary collapse
- #as_json(options = {}) ⇒ Object
-
#initialize(options) ⇒ ErrorBody
constructor
A new instance of ErrorBody.
- #to_json(*options) ⇒ Object
Constructor Details
#initialize(options) ⇒ ErrorBody
Returns a new instance of ErrorBody.
8 9 10 11 12 |
# File 'lib/pusher-platform/common.rb', line 8 def initialize() @error = [:error] @error_description = [:error_description] @error_uri = [:error_uri] end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'lib/pusher-platform/common.rb', line 6 def error @error end |
#error_description ⇒ Object (readonly)
Returns the value of attribute error_description.
6 7 8 |
# File 'lib/pusher-platform/common.rb', line 6 def error_description @error_description end |
#error_uri ⇒ Object (readonly)
Returns the value of attribute error_uri.
6 7 8 |
# File 'lib/pusher-platform/common.rb', line 6 def error_uri @error_uri end |
Instance Method Details
#as_json(options = {}) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/pusher-platform/common.rb', line 14 def as_json( = {}) json = { error: @error, error_description: @error_description, } json[:error_uri] = @error_uri unless @error_uri.nil? json end |
#to_json(*options) ⇒ Object
23 24 25 |
# File 'lib/pusher-platform/common.rb', line 23 def to_json(*) as_json(*).to_json(*) end |