Class: Assently::Client::ErrorResult
- Inherits:
-
Object
- Object
- Assently::Client::ErrorResult
- Defined in:
- lib/assently/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.
112 113 114 |
# File 'lib/assently/client.rb', line 112 def initialize response @raw = response end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
110 111 112 |
# File 'lib/assently/client.rb', line 110 def raw @raw end |
Instance Method Details
#errors ⇒ Object
116 117 118 119 120 121 122 |
# File 'lib/assently/client.rb', line 116 def errors begin Array(JSON.parse(raw)["error"].values.join(" ")) rescue JSON::ParserError raw end end |
#success? ⇒ Boolean
124 125 126 |
# File 'lib/assently/client.rb', line 124 def success? false end |