Class: Io::Flow::V0::Models::RefundIdentifier

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 = {}) ⇒ RefundIdentifier



55972
55973
55974
55975
55976
55977
55978
55979
55980
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55972

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :refund, :name, :identifier, :primary], 'RefundIdentifier')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
  @refund = (x = opts.delete(:refund); x.is_a?(::Io::Flow::V0::Models::RefundReference) ? x : ::Io::Flow::V0::Models::RefundReference.new(x))
  @name = HttpClient::Preconditions.assert_class('name', opts.delete(:name), String)
  @identifier = HttpClient::Preconditions.assert_class('identifier', opts.delete(:identifier), String)
  @primary = HttpClient::Preconditions.assert_boolean('primary', opts.delete(:primary))
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



55970
55971
55972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55970

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



55970
55971
55972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55970

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



55970
55971
55972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55970

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



55970
55971
55972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55970

def primary
  @primary
end

#refundObject (readonly)

Returns the value of attribute refund.



55970
55971
55972
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55970

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



55986
55987
55988
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55986

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

#to_hashObject



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

def to_hash
  {
    :id => id,
    :refund => refund.to_hash,
    :name => name,
    :identifier => identifier,
    :primary => primary
  }
end

#to_jsonObject



55982
55983
55984
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 55982

def to_json
  JSON.dump(to_hash)
end