Class: Io::Flow::V0::Models::SettlementPayout
- Inherits:
-
Settlement
- Object
- Settlement
- Io::Flow::V0::Models::SettlementPayout
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#amount ⇒ Object
readonly
Returns the value of attribute amount.
-
#sent_on ⇒ Object
readonly
Returns the value of attribute sent_on.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Attributes inherited from Settlement
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ SettlementPayout
constructor
A new instance of SettlementPayout.
- #subtype_to_hash ⇒ Object
- #to_json ⇒ Object
Methods inherited from Settlement
Constructor Details
#initialize(incoming = {}) ⇒ SettlementPayout
Returns a new instance of SettlementPayout.
65731 65732 65733 65734 65735 65736 65737 65738 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65731 def initialize(incoming={}) super(:discriminator => Settlement::Types::SETTLEMENT_PAYOUT) opts = HttpClient::Helper.symbolize_keys(incoming) HttpClient::Preconditions.require_keys(opts, [:status, :amount], 'SettlementPayout') @status = (x = opts.delete(:status); x.is_a?(::Io::Flow::V0::Models::PayoutStatus) ? x : ::Io::Flow::V0::Models::PayoutStatus.from_json(x)) @amount = HttpClient::Preconditions.assert_class('amount', HttpClient::Helper.to_big_decimal(opts.delete(:amount)), BigDecimal) @sent_on = (x = opts.delete(:sent_on); x.nil? ? nil : HttpClient::Preconditions.assert_class('sent_on', HttpClient::Helper.to_date_time_iso8601(x), DateTime)) end |
Instance Attribute Details
#amount ⇒ Object (readonly)
Returns the value of attribute amount.
65729 65730 65731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65729 def amount @amount end |
#sent_on ⇒ Object (readonly)
Returns the value of attribute sent_on.
65729 65730 65731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65729 def sent_on @sent_on end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
65729 65730 65731 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65729 def status @status end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
65744 65745 65746 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65744 def copy(incoming={}) SettlementPayout.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#subtype_to_hash ⇒ Object
65748 65749 65750 65751 65752 65753 65754 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65748 def subtype_to_hash { :status => status.to_hash, :amount => amount.to_f.to_s, :sent_on => sent_on } end |
#to_json ⇒ Object
65740 65741 65742 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 65740 def to_json JSON.dump(to_hash) end |