Class: Coinone::Transaction
- Inherits:
-
Object
- Object
- Coinone::Transaction
- Defined in:
- lib/coinone/transaction.rb,
lib/coinone/transaction/krw_history.rb,
lib/coinone/transaction/coin_history.rb,
lib/coinone/transaction/send_coin_response.rb,
lib/coinone/transaction/krw_history/history.rb,
lib/coinone/transaction/auth_number_response.rb,
lib/coinone/transaction/coin_history/history.rb
Defined Under Namespace
Classes: AuthNumberResponse, CoinHistory, KrwHistory, SendCoinResponse
Instance Attribute Summary collapse
-
#auth_number_response ⇒ Object
readonly
Returns the value of attribute auth_number_response.
-
#coin_history ⇒ Object
readonly
Returns the value of attribute coin_history.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#krw_history ⇒ Object
readonly
Returns the value of attribute krw_history.
-
#send_coin_response ⇒ Object
readonly
Returns the value of attribute send_coin_response.
Instance Method Summary collapse
- #get_auth_number(options = {}) ⇒ Object
- #get_coin_history(options = {}) ⇒ Object
- #get_krw_history(options = {}) ⇒ Object
-
#initialize(options = {}, connection = nil) ⇒ Transaction
constructor
A new instance of Transaction.
- #send_coin(options = {}) ⇒ Object
Constructor Details
#initialize(options = {}, connection = nil) ⇒ Transaction
Returns a new instance of Transaction.
13 14 15 16 17 18 19 20 21 |
# File 'lib/coinone/transaction.rb', line 13 def initialize(={}, connection=nil) @connection = connection || Connection.factory() @auth_number_response = AuthNumberResponse.new() @coin_history = CoinHistory.new() @krw_history = KrwHistory.new() @send_coin_response = SendCoinResponse.new() end |
Instance Attribute Details
#auth_number_response ⇒ Object (readonly)
Returns the value of attribute auth_number_response.
11 12 13 |
# File 'lib/coinone/transaction.rb', line 11 def auth_number_response @auth_number_response end |
#coin_history ⇒ Object (readonly)
Returns the value of attribute coin_history.
11 12 13 |
# File 'lib/coinone/transaction.rb', line 11 def coin_history @coin_history end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
10 11 12 |
# File 'lib/coinone/transaction.rb', line 10 def connection @connection end |
#krw_history ⇒ Object (readonly)
Returns the value of attribute krw_history.
11 12 13 |
# File 'lib/coinone/transaction.rb', line 11 def krw_history @krw_history end |
#send_coin_response ⇒ Object (readonly)
Returns the value of attribute send_coin_response.
11 12 13 |
# File 'lib/coinone/transaction.rb', line 11 def send_coin_response @send_coin_response end |
Instance Method Details
#get_auth_number(options = {}) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/coinone/transaction.rb', line 24 def get_auth_number(={}) response = @connection.post( "/v2/transaction/auth_number/", ) @auth_number_response.update_response(response) @auth_number_response end |
#get_coin_history(options = {}) ⇒ Object
32 33 34 35 36 37 38 39 |
# File 'lib/coinone/transaction.rb', line 32 def get_coin_history(={}) response = @connection.post("/v2/transaction/history/", ) @coin_history.update_histories(response) @coin_history end |
#get_krw_history(options = {}) ⇒ Object
41 42 43 44 45 46 47 48 |
# File 'lib/coinone/transaction.rb', line 41 def get_krw_history(={}) response = @connection.post("/v2/transaction/krw/history/", ) @krw_history.update_histories(response) @krw_history end |
#send_coin(options = {}) ⇒ Object
50 51 52 53 54 55 56 57 58 |
# File 'lib/coinone/transaction.rb', line 50 def send_coin(={}) response = @connection.post("/v2/transaction/coin/", ) #response = {txid: "Txid"} @send_coin_response.update_response(response.merge({ currency: [:currency]})) @send_coin_response end |