Class: Io::Flow::V0::Models::ConsumerInvoicePayment
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::ConsumerInvoicePayment
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#billing_address ⇒ Object
readonly
Returns the value of attribute billing_address.
-
#date ⇒ Object
readonly
Returns the value of attribute date.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ ConsumerInvoicePayment
constructor
A new instance of ConsumerInvoicePayment.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ ConsumerInvoicePayment
Returns a new instance of ConsumerInvoicePayment.
27025 27026 27027 27028 27029 27030 27031 27032 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27025 def initialize(incoming={}) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:date, :description, :value], 'ConsumerInvoicePayment') @date = HttpClient::Preconditions.assert_class('date', HttpClient::Helper.to_date_time_iso8601(opts.delete(:date)), DateTime) @description = HttpClient::Preconditions.assert_class('description', opts.delete(:description), String) @value = (x = opts.delete(:value); x.is_a?(::Io::Flow::V0::Models::Price) ? x : ::Io::Flow::V0::Models::Price.new(x)) @billing_address = (x = opts.delete(:billing_address); x.nil? ? nil : (x = x; x.is_a?(::Io::Flow::V0::Models::BillingAddress) ? x : ::Io::Flow::V0::Models::BillingAddress.new(x))) end |
Instance Attribute Details
#billing_address ⇒ Object (readonly)
Returns the value of attribute billing_address.
27023 27024 27025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27023 def billing_address @billing_address end |
#date ⇒ Object (readonly)
Returns the value of attribute date.
27023 27024 27025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27023 def date @date end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
27023 27024 27025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27023 def description @description end |
#value ⇒ Object (readonly)
Returns the value of attribute value.
27023 27024 27025 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27023 def value @value end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
27038 27039 27040 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27038 def copy(incoming={}) ConsumerInvoicePayment.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
27042 27043 27044 27045 27046 27047 27048 27049 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27042 def to_hash { :date => date, :description => description, :value => value.to_hash, :billing_address => billing_address.nil? ? nil : billing_address.to_hash } end |
#to_json ⇒ Object
27034 27035 27036 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 27034 def to_json JSON.dump(to_hash) end |