Class: Io::Flow::V0::Models::CreditPaymentError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::CreditPaymentError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#codes ⇒ Object
readonly
Returns the value of attribute codes.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ CreditPaymentError
constructor
A new instance of CreditPaymentError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ CreditPaymentError
Returns a new instance of CreditPaymentError.
15059 15060 15061 15062 15063 15064 15065 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15059 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code, :messages, :codes], 'CreditPaymentError') @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::CreditPaymentErrorCode) ? x : ::Io::Flow::V0::Models::CreditPaymentErrorCode.apply(x)) = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @codes = HttpClient::Preconditions.assert_class('codes', opts.delete(:codes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::CreditPaymentErrorCode) ? x : ::Io::Flow::V0::Models::CreditPaymentErrorCode.apply(x)) } end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
15057 15058 15059 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15057 def code @code end |
#codes ⇒ Object (readonly)
Returns the value of attribute codes.
15057 15058 15059 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15057 def codes @codes end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
15057 15058 15059 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15057 def end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
15071 15072 15073 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15071 def copy(incoming={}) CreditPaymentError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
15075 15076 15077 15078 15079 15080 15081 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15075 def to_hash { :code => code.value, :messages => , :codes => codes.map { |o| o.value } } end |
#to_json ⇒ Object
15067 15068 15069 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 15067 def to_json JSON.dump(to_hash) end |