Class: Egree::Client::ErrorResult
- Inherits:
-
Object
- Object
- Egree::Client::ErrorResult
- Defined in:
- lib/egree/client.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
- #errors ⇒ Object
-
#initialize(response) ⇒ ErrorResult
constructor
A new instance of ErrorResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(response) ⇒ ErrorResult
Returns a new instance of ErrorResult.
97 98 99 |
# File 'lib/egree/client.rb', line 97 def initialize response @raw = response end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
95 96 97 |
# File 'lib/egree/client.rb', line 95 def raw @raw end |
Instance Method Details
#errors ⇒ Object
101 102 103 104 105 106 107 |
# File 'lib/egree/client.rb', line 101 def errors begin Array(JSON.parse(raw)["error"].values.join(" ")) rescue JSON::ParserError raw end end |
#success? ⇒ Boolean
109 110 111 |
# File 'lib/egree/client.rb', line 109 def success? false end |