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.



120
121
122
# File 'lib/assently/client.rb', line 120

def initialize response
  @raw = response
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



118
119
120
# File 'lib/assently/client.rb', line 118

def raw
  @raw
end

Instance Method Details

#errorsObject



124
125
126
127
128
129
130
# File 'lib/assently/client.rb', line 124

def errors
  begin
    Array(JSON.parse(raw)["error"].values.join(" "))
  rescue JSON::ParserError
    raw
  end
end

#success?Boolean

Returns:

  • (Boolean)


132
133
134
# File 'lib/assently/client.rb', line 132

def success?
  false
end