Class: Coinone::Transaction::KrwHistory::History

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ History

Returns a new instance of History.



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/coinone/transaction/krw_history/history.rb', line 10

def initialize(options={})

  @bank_code = nil
  @account_number = nil
  @depositor = nil
  @amount = nil
  @process_level = nil
  @timestamp = nil

  update_history(options)


end

Instance Attribute Details

#account_numberObject (readonly)

Returns the value of attribute account_number.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def 
  @account_number
end

#amountObject (readonly)

Returns the value of attribute amount.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def amount
  @amount
end

#bank_codeObject (readonly)

Returns the value of attribute bank_code.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def bank_code
  @bank_code
end

#depositorObject (readonly)

Returns the value of attribute depositor.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def depositor
  @depositor
end

#process_levelObject (readonly)

Returns the value of attribute process_level.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def process_level
  @process_level
end

#timestampObject (readonly)

Returns the value of attribute timestamp.



8
9
10
# File 'lib/coinone/transaction/krw_history/history.rb', line 8

def timestamp
  @timestamp
end

Instance Method Details

#process_level_to_sObject



35
36
37
38
39
40
41
42
43
# File 'lib/coinone/transaction/krw_history/history.rb', line 35

def process_level_to_s
  level_list = ["", "Deposit Completed", "Request Withdrawal", "Request Accepted", "Withrawal Canceled", "Withdrawal Completed"]
  if @process_level.blank?
    str = ""
  else
    str = level_list[@process_level]
  end
  str
end

#update_history(params = {}) ⇒ Object



24
25
26
27
28
29
30
31
32
33
# File 'lib/coinone/transaction/krw_history/history.rb', line 24

def update_history(params={})

  @bank_code = params[:bankCode].to_i if (params.has_key? :bankCode) && !params[:bankCode].nil?
  @account_number = params[:accountNumber].strip if (params.has_key? :accountNumber) && !params[:accountNumber].nil?
  @depositor =  params[:depositor].strip if (params.has_key? :depositor) && !params[:depositor].nil?
  @amount =  params[:amount].to_i if params.has_key? :amount
  @process_level =  params[:processLevel].to_i if (params.has_key? :processLevel) && !params[:processLevel].nil?
  @timestamp =  params[:timestamp].to_i if params.has_key? :timestamp

end