Class: Io::Flow::V0::Models::VirtualCardReference

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

Returns a new instance of VirtualCardReference.



40542
40543
40544
40545
40546
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40542

def initialize(incoming={})
  opts = HttpClient::Helper.symbolize_keys(incoming)
  HttpClient::Preconditions.require_keys(opts, [:id], 'VirtualCardReference')
  @id = HttpClient::Preconditions.assert_class('id', opts.delete(:id), String)
end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



40540
40541
40542
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40540

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



40552
40553
40554
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40552

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

#to_hashObject



40556
40557
40558
40559
40560
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40556

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



40548
40549
40550
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 40548

def to_json
  JSON.dump(to_hash)
end