Class: Io::Flow::V0::Models::MerchantGiftCardReversal

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

Returns a new instance of MerchantGiftCardReversal.



38158
38159
38160
38161
38162
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38158

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

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



38156
38157
38158
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38156

def id
  @id
end

Instance Method Details

#copy(incoming = {}) ⇒ Object



38168
38169
38170
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38168

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

#to_hashObject



38172
38173
38174
38175
38176
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38172

def to_hash
  {
    :id => id
  }
end

#to_jsonObject



38164
38165
38166
# File 'lib/flow_commerce/flow_api_v0_client.rb', line 38164

def to_json
  JSON.dump(to_hash)
end