Exception: FbGraph::Exception
- Inherits:
-
StandardError
- Object
- StandardError
- FbGraph::Exception
- Defined in:
- lib/fb_graph.rb
Direct Known Subclasses
Auth::VerificationFailed, BadRequest, NotFound, Unauthorized
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#message ⇒ Object
Returns the value of attribute message.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(code, message, body = '') ⇒ Exception
constructor
A new instance of Exception.
Constructor Details
#initialize(code, message, body = '') ⇒ Exception
Returns a new instance of Exception.
16 17 18 19 20 21 22 23 24 25 |
# File 'lib/fb_graph.rb', line 16 def initialize(code, , body = '') @code = code if body.blank? @message = else response = JSON.parse(body).with_indifferent_access @message = response[:error][:message] @type = response[:error][:type] end end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
15 16 17 |
# File 'lib/fb_graph.rb', line 15 def code @code end |
#message ⇒ Object
Returns the value of attribute message.
15 16 17 |
# File 'lib/fb_graph.rb', line 15 def @message end |
#type ⇒ Object
Returns the value of attribute type.
15 16 17 |
# File 'lib/fb_graph.rb', line 15 def type @type end |