Class: Btc::Rpc
Class Method Summary collapse
Class Method Details
.query(method, params, settings) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/btc/rpc.rb', line 8 def query(method, params, settings) auth = { :username => settings[:username], :password => settings[:password] } = { :method => method, :jsonrpc => "2.0", :id => randid, :params => params, :basic_auth => auth } begin post(settings[:url], ) rescue Errno::ECONNREFUSED raise Btc::DaemonError end end |
.randid ⇒ Object
29 30 31 |
# File 'lib/btc/rpc.rb', line 29 def randid (rand * 10 ** 12).to_i.to_s end |