Class: Egree::Client::ErrorResult

Inherits:
Object
  • Object
show all
Defined in:
lib/egree/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (readonly)

Returns the value of attribute raw.



95
96
97
# File 'lib/egree/client.rb', line 95

def raw
  @raw
end

Instance Method Details

#errorsObject



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

Returns:

  • (Boolean)


109
110
111
# File 'lib/egree/client.rb', line 109

def success?
  false
end