Class: Io::Flow::V0::Models::VirtualCardForm

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



33436
33437
33438
33439
33440
33441
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33436

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:limit], 'VirtualCardForm')
  @limit = (x = opts.delete(:limit); x.is_a?(::Io::Flow::V0::Models::Money) ? x : ::Io::Flow::V0::Models::Money.new(x))
  @attributes = (x = opts.delete(:attributes); x.nil? ? nil : HttpClient::Preconditions.assert_class('attributes', x, Hash).inject({}) { |h, d| h[d[0]] = HttpClient::Preconditions.assert_class('attributes', d[1], String); h })
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



33434
33435
33436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33434

def attributes
  @attributes
end

#limitObject (readonly)

Returns the value of attribute limit.



33434
33435
33436
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33434

def limit
  @limit
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



33447
33448
33449
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33447

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

#to_hashObject



33451
33452
33453
33454
33455
33456
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33451

def to_hash
  {
    :limit => limit.to_hash,
    :attributes => attributes.nil? ? nil : attributes
  }
end

#to_jsonObject



33443
33444
33445
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 33443

def to_json
  JSON.dump(to_hash)
end