Class: Coinone::Transaction::CoinHistory::History

Inherits:
Object
  • Object
show all
Defined in:
lib/coinone/transaction/coin_history/history.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ History



12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/coinone/transaction/coin_history/history.rb', line 12

def initialize(options={})

  @txid = nil
  @type = nil
  @from = nil
  @to = nil
  @confirmations = nil
  @quantity = nil
  @timestamp = nil

  update_history(options)

end

Instance Attribute Details

#confirmationsObject (readonly)

Returns the value of attribute confirmations.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def confirmations
  @confirmations
end

#fromObject (readonly)

Returns the value of attribute from.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def from
  @from
end

#quantityObject (readonly)

Returns the value of attribute quantity.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def quantity
  @quantity
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def timestamp
  @timestamp
end

#toObject (readonly)

Returns the value of attribute to.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def to
  @to
end

#txidObject (readonly)

Returns the value of attribute txid.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def txid
  @txid
end

#typeObject (readonly)

Returns the value of attribute type.



10
11
12
# File 'lib/coinone/transaction/coin_history/history.rb', line 10

def type
  @type
end

Instance Method Details

#update_history(params = {}) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/coinone/transaction/coin_history/history.rb', line 26

def update_history(params={})


  @txid = params[:txid] if params.has_key? :txid
  @type = params[:type] if params.has_key? :type
  @from = params[:from] if params.has_key? :from
  @to = params[:to] if params.has_key? :to
  @confirmations = params[:confirmations].to_i if params.has_key? :confirmations
  @quantity = params[:quantity].to_f if params.has_key? :quantity
  @timestamp = params[:timestamp].to_i if params.has_key? :timestamp

end