Module: Bitstamp
- Defined in:
- lib/bitstamp.rb,
lib/bitstamp/net.rb,
lib/bitstamp/model.rb,
lib/bitstamp/helper.rb,
lib/bitstamp/orders.rb,
lib/bitstamp/ticker.rb,
lib/bitstamp/collection.rb,
lib/bitstamp/transactions.rb
Defined Under Namespace
Modules: Helper, Net
Classes: Collection, MissingConfigExeception, Model, Order, Orders, Ticker, Transactions, UserTransaction, UserTransactions
Constant Summary
collapse
- @@currency =
:usd
Class Method Summary
collapse
Class Method Details
.balance ⇒ Object
48
49
50
51
52
|
# File 'lib/bitstamp.rb', line 48
def self.balance
self.sanity_check!
JSON.parse Bitstamp::Net.post('/balance').body_str
end
|
66
67
68
|
# File 'lib/bitstamp.rb', line 66
def self.configured?
self.key && self.secret && self.client_id
end
|
.order_book ⇒ Object
58
59
60
|
# File 'lib/bitstamp.rb', line 58
def self.order_book
return JSON.parse Bitstamp::Net.get('/order_book/').body_str
end
|
.orders ⇒ Object
32
33
34
35
36
|
# File 'lib/bitstamp.rb', line 32
def self.orders
self.sanity_check!
@@orders ||= Bitstamp::Orders.new
end
|
.sanity_check! ⇒ Object
70
71
72
73
74
|
# File 'lib/bitstamp.rb', line 70
def self.sanity_check!
unless configured?
raise MissingConfigExeception.new("Bitstamp Gem not properly configured")
end
end
|
.setup {|_self| ... } ⇒ Object
62
63
64
|
# File 'lib/bitstamp.rb', line 62
def self.setup
yield self
end
|
.user_transactions ⇒ Object
38
39
40
41
42
|
# File 'lib/bitstamp.rb', line 38
def self.user_transactions
self.sanity_check!
@@transactions ||= Bitstamp::UserTransactions.new
end
|