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.



47266
47267
47268
47269
47270
47271
47272
47273
47274
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47266

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.



47264
47265
47266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47264

def id
  @id
end

#identifierObject (readonly)

Returns the value of attribute identifier.



47264
47265
47266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47264

def identifier
  @identifier
end

#nameObject (readonly)

Returns the value of attribute name.



47264
47265
47266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47264

def name
  @name
end

#primaryObject (readonly)

Returns the value of attribute primary.



47264
47265
47266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47264

def primary
  @primary
end

#refundObject (readonly)

Returns the value of attribute refund.



47264
47265
47266
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47264

def refund
  @refund
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



47280
47281
47282
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47280

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

#to_hashObject



47284
47285
47286
47287
47288
47289
47290
47291
47292
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47284

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

#to_jsonObject



47276
47277
47278
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 47276

def to_json
  JSON.dump(to_hash)
end