Class: Io::Flow::V0::Models::GenericError
- Inherits:
-
OrderError
- Object
- OrderError
- Io::Flow::V0::Models::GenericError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Overview
An error of some type has occured. The most common error will be validation on input. See messages for details.
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ GenericError
constructor
A new instance of GenericError.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from OrderError
Constructor Details
#initialize(incoming = {}) ⇒ GenericError
Returns a new instance of GenericError.
10360 10361 10362 10363 10364 10365 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10360 def initialize(incoming={}) super(:name => OrderError::Types::GENERIC_ERROR) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:messages], 'GenericError') = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
10358 10359 10360 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10358 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
10371 10372 10373 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10371 def copy(incoming={}) GenericError.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
10375 10376 10377 10378 10379 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10375 def subtype_to_hash { :messages => } end |
#to_json ⇒ Object
10367 10368 10369 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 10367 def to_json JSON.dump(to_hash) end |