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

Returns a new instance of RefundIdentifier.



34219
34220
34221
34222
34223
34224
34225
34226
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34219

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.



34217
34218
34219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34217

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



34217
34218
34219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34217

def identifier
  @identifier
end

#primaryObject (readonly)

Returns the value of attribute primary.



34217
34218
34219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34217

def primary
  @primary
end

#refundObject (readonly)

Returns the value of attribute refund.



34217
34218
34219
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34217

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



34232
34233
34234
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34232

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

#to_hashObject



34236
34237
34238
34239
34240
34241
34242
34243
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34236

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

#to_jsonObject



34228
34229
34230
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 34228

def to_json
  JSON.dump(to_hash)
end