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, MissingConfigExecption, Model, Order, Orders, Ticker, UserTransaction, UserTransactions
Constant Summary
collapse
- @@currency =
:usd
Class Method Summary
collapse
Class Method Details
.balance ⇒ Object
40
41
42
43
44
|
# File 'lib/bitstamp.rb', line 40
def self.balance
self.sanity_check!
JSON.parse Bitstamp::Net.post('/balance').body_str
end
|
.order_book ⇒ Object
50
51
52
|
# File 'lib/bitstamp.rb', line 50
def self.order_book
return JSON.parse Bitstamp::Net.post('/order_book/').body_str
end
|
.orders ⇒ Object
28
29
30
31
32
|
# File 'lib/bitstamp.rb', line 28
def self.orders
self.sanity_check!
@@orders ||= Bitstamp::Orders.new
end
|
.sanity_check! ⇒ Object
58
59
60
61
62
|
# File 'lib/bitstamp.rb', line 58
def self.sanity_check!
unless self.key || self.secret
raise MissingConfigExecption.new("Bitstamp Gem not properly configured")
end
end
|
.setup {|_self| ... } ⇒ Object
54
55
56
|
# File 'lib/bitstamp.rb', line 54
def self.setup
yield self
end
|
.user_transactions ⇒ Object
34
35
36
37
38
|
# File 'lib/bitstamp.rb', line 34
def self.user_transactions
self.sanity_check!
@@transactions ||= Bitstamp::UserTransactions.new
end
|