Class: Io::Flow::V0::Models::OrderRefundSummaryPartialForm

Inherits:
OrderRefundSummaryForm show all
Defined in:
lib/flow_commerce/flow_api_v0_client.rb

Instance Attribute Summary collapse

Attributes inherited from OrderRefundSummaryForm

#discriminator

Instance Method Summary collapse

Methods inherited from OrderRefundSummaryForm

from_json, #to_hash

Constructor Details

#initialize(incoming = {}) ⇒ OrderRefundSummaryPartialForm

Returns a new instance of OrderRefundSummaryPartialForm.



53791
53792
53793
53794
53795
53796
53797
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53791

def initialize(incoming={})
  super(:discriminator => OrderRefundSummaryForm::Types::ORDER_REFUND_SUMMARY_PARTIAL_FORM)
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:includes, :items], 'OrderRefundSummaryPartialForm')
  @includes = HttpClient::Preconditions.assert_class('includes', opts.delete(:includes), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderRefundSummaryPartialIncludes) ? x : ::Io::Flow::V0::Models::OrderRefundSummaryPartialIncludes.new(x)) }
  @items = HttpClient::Preconditions.assert_class('items', opts.delete(:items), Array).map { |v| (x = v; x.is_a?(::Io::Flow::V0::Models::OrderRefundSummaryItem) ? x : ::Io::Flow::V0::Models::OrderRefundSummaryItem.new(x)) }
end

Instance Attribute Details

#includesObject (readonly)

Returns the value of attribute includes.



53789
53790
53791
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53789

def includes
  @includes
end

#itemsObject (readonly)

Returns the value of attribute items.



53789
53790
53791
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53789

def items
  @items
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



53803
53804
53805
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53803

def copy(incoming={})
  OrderRefundSummaryPartialForm.new(subtype_to_hash.merge(HttpClient::Helper.symbolize_keys(incoming)))
end

#subtype_to_hashObject



53807
53808
53809
53810
53811
53812
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53807

def subtype_to_hash
  {
    :includes => includes.map { |o| o.to_hash },
    :items => items.map { |o| o.to_hash }
  }
end

#to_jsonObject



53799
53800
53801
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 53799

def to_json
  JSON.dump(to_hash)
end