Class: Io::Flow::V0::Models::RefundError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::RefundError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#decline_code ⇒ Object
readonly
Returns the value of attribute decline_code.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ RefundError
constructor
A new instance of RefundError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ RefundError
Returns a new instance of RefundError.
24967 24968 24969 24970 24971 24972 24973 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24967 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:messages, :decline_code], 'RefundError') @code = (x = (x = opts.delete(:code); x.nil? ? "generic_error" : x); x.is_a?(::Io::Flow::V0::Models::GenericErrorCode) ? x : ::Io::Flow::V0::Models::GenericErrorCode.apply(x)) @messages = HttpClient::Preconditions.assert_class('messages', opts.delete(:messages), Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) } @decline_code = (x = opts.delete(:decline_code); x.is_a?(::Io::Flow::V0::Models::RefundDeclineCode) ? x : ::Io::Flow::V0::Models::RefundDeclineCode.apply(x)) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
24965 24966 24967 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24965 def code @code end |
#decline_code ⇒ Object (readonly)
Returns the value of attribute decline_code.
24965 24966 24967 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24965 def decline_code @decline_code end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
24965 24966 24967 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24965 def @messages end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
24979 24980 24981 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24979 def copy(incoming={}) RefundError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
24983 24984 24985 24986 24987 24988 24989 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24983 def to_hash { :code => code.value, :messages => , :decline_code => decline_code.value } end |
#to_json ⇒ Object
24975 24976 24977 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 24975 def to_json JSON.dump(to_hash) end |