Class: Coinone::Transaction::SendCoinResponse
- Inherits:
-
Object
- Object
- Coinone::Transaction::SendCoinResponse
- Defined in:
- lib/coinone/transaction/send_coin_response.rb
Instance Attribute Summary collapse
-
#currency ⇒ Object
readonly
Returns the value of attribute currency.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#txid ⇒ Object
readonly
Returns the value of attribute txid.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SendCoinResponse
constructor
A new instance of SendCoinResponse.
- #transaction_url ⇒ Object
- #update_response(params = {}) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ SendCoinResponse
Returns a new instance of SendCoinResponse.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 11 def initialize(={}) @result = [:result] || nil @txid = nil @currency = [:currency] || nil update_response() end |
Instance Attribute Details
#currency ⇒ Object (readonly)
Returns the value of attribute currency.
9 10 11 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 9 def currency @currency end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
8 9 10 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 8 def result @result end |
#txid ⇒ Object (readonly)
Returns the value of attribute txid.
9 10 11 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 9 def txid @txid end |
Instance Method Details
#transaction_url ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 30 def transaction_url url = nil url = "https://blockchain.info/tx/#{txid}" if @currency == "btc" url = "https://etherscan.io/tx/#{txid}" if @currency == "eth" url = "https://gastracker.io/tx/#{txid}" if @currency == "etc" url end |
#update_response(params = {}) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/coinone/transaction/send_coin_response.rb', line 22 def update_response(params={}) @result = params[:result] if params.has_key? :result @txid = params[:txid] if params.has_key? :txid @currency = params[:currency].downcase if params.has_key? :currency end |