Class: Assently::Client::ErrorResult

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#rawObject (readonly)

Returns the value of attribute raw.



110
111
112
# File 'lib/assently/client.rb', line 110

def raw
  @raw
end

Instance Method Details

#errorsObject



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

Returns:

  • (Boolean)


124
125
126
# File 'lib/assently/client.rb', line 124

def success?
  false
end