Class: Io::Flow::V0::Models::MerchantGiftCardError
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::MerchantGiftCardError
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ MerchantGiftCardError
constructor
A new instance of MerchantGiftCardError.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ MerchantGiftCardError
Returns a new instance of MerchantGiftCardError.
36661 36662 36663 36664 36665 36666 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36661 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:code], 'MerchantGiftCardError') @code = (x = opts.delete(:code); x.is_a?(::Io::Flow::V0::Models::MerchantGiftCardErrorCode) ? x : ::Io::Flow::V0::Models::MerchantGiftCardErrorCode.apply(x)) @messages = (x = opts.delete(:messages); x.nil? ? nil : HttpClient::Preconditions.assert_class('messages', x, Array).map { |v| HttpClient::Preconditions.assert_class('messages', v, String) }) end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
36659 36660 36661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36659 def code @code end |
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
36659 36660 36661 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36659 def @messages end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
36672 36673 36674 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36672 def copy(incoming={}) MerchantGiftCardError.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
36676 36677 36678 36679 36680 36681 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36676 def to_hash { :code => code.value, :messages => .nil? ? nil : } end |
#to_json ⇒ Object
36668 36669 36670 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 36668 def to_json JSON.dump(to_hash) end |