Exception: ChartMogul::Client::ValidationError

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ ValidationError

Returns a new instance of ValidationError.



79
80
81
82
83
84
85
86
87
# File 'lib/chart_mogul/client.rb', line 79

def initialize(result)
  @body = result
  if result[:errors]
    @errors = result[:errors]
    super("validation errors for #{@errors.keys.join(', ')}")
  else
    super("validation errors #{@body}")
  end
end

Instance Attribute Details

#bodyObject (readonly)

Returns the value of attribute body.



77
78
79
# File 'lib/chart_mogul/client.rb', line 77

def body
  @body
end

#errorsObject (readonly)

Returns the value of attribute errors.



76
77
78
# File 'lib/chart_mogul/client.rb', line 76

def errors
  @errors
end