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



42019
42020
42021
42022
42023
42024
42025
42026
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42019

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id, :refund, :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))
  @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.



42017
42018
42019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42017

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



42017
42018
42019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42017

def identifier
  @identifier
end

#primaryObject (readonly)

Returns the value of attribute primary.



42017
42018
42019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42017

def primary
  @primary
end

#refundObject (readonly)

Returns the value of attribute refund.



42017
42018
42019
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42017

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



42032
42033
42034
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42032

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

#to_hashObject



42036
42037
42038
42039
42040
42041
42042
42043
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42036

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

#to_jsonObject



42028
42029
42030
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 42028

def to_json
  JSON.dump(to_hash)
end