Class: Cryptoprocessing::APIObject

Inherits:
Hash
  • Object
show all
Defined in:
lib/cryptoprocessing/models/api_object.rb

Direct Known Subclasses

Account, Address, Callback, Tracker, Transaction, User

Instance Method Summary collapse

Constructor Details

#initialize(client, data) ⇒ APIObject

Returns a new instance of APIObject.



3
4
5
6
7
# File 'lib/cryptoprocessing/models/api_object.rb', line 3

def initialize(client, data)
  super()
  update(data)
  @client = client
end

Instance Method Details

#update(data) ⇒ Object



9
10
11
12
# File 'lib/cryptoprocessing/models/api_object.rb', line 9

def update(data)
  return if data.nil?
  data.each {|key, val| self[key] = val} if data.is_a?(Hash)
end