Class: Io::Flow::V0::Models::VirtualCardForm
- Inherits:
-
Object
- Object
- Io::Flow::V0::Models::VirtualCardForm
- Defined in:
- lib/flow_commerce/flow_api_v0_client.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
Instance Method Summary collapse
- #copy(incoming = {}) ⇒ Object
-
#initialize(incoming = {}) ⇒ VirtualCardForm
constructor
A new instance of VirtualCardForm.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(incoming = {}) ⇒ VirtualCardForm
Returns a new instance of VirtualCardForm.
72508 72509 72510 72511 72512 72513 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72508 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
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
72506 72507 72508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72506 def attributes @attributes end |
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
72506 72507 72508 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72506 def limit @limit end |
Instance Method Details
#copy(incoming = {}) ⇒ Object
72519 72520 72521 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72519 def copy(incoming={}) VirtualCardForm.new(to_hash.merge(HttpClient::Helper.symbolize_keys(incoming))) end |
#to_hash ⇒ Object
72523 72524 72525 72526 72527 72528 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72523 def to_hash { :limit => limit.to_hash, :attributes => attributes.nil? ? nil : attributes } end |
#to_json ⇒ Object
72515 72516 72517 |
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 72515 def to_json JSON.dump(to_hash) end |