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



40514
40515
40516
40517
40518
40519
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40514

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.



40512
40513
40514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40512

def attributes
  @attributes
end

#limitObject (readonly)

Returns the value of attribute limit.



40512
40513
40514
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40512

def limit
  @limit
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40525
40526
40527
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40525

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

#to_hashObject



40529
40530
40531
40532
40533
40534
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40529

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

#to_jsonObject



40521
40522
40523
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40521

def to_json
  JSON.dump(to_hash)
end