Class: Io::Flow::V0::Models::ParentTransactionSummary

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(incoming = {}) ⇒ ParentTransactionSummary

Returns a new instance of ParentTransactionSummary.



55991
55992
55993
55994
55995
55996
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55991

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :source], 'ParentTransactionSummary')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @source = (x = opts.delete(:source); x.is_a?(::Io::Flow::V0::Models::TransactionSource) ? x : ::Io::Flow::V0::Models::TransactionSource.apply(x))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



55989
55990
55991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55989

def id
  @id
end

#sourceObject (readonly)

Returns the value of attribute source.



55989
55990
55991
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55989

def source
  @source
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



56002
56003
56004
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56002

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

#to_hashObject



56006
56007
56008
56009
56010
56011
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 56006

def to_hash
  {
    :id => id,
    :source => source.value
  }
end

#to_jsonObject



55998
55999
56000
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55998

def to_json
  JSON.dump(to_hash)
end