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

.balanceObject



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_bookObject



50
51
52
# File 'lib/bitstamp.rb', line 50

def self.order_book
  return JSON.parse Bitstamp::Net.post('/order_book/').body_str
end

.ordersObject



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

Yields:

  • (_self)

Yield Parameters:

  • _self (Bitstamp)

    the object that the method was called on



54
55
56
# File 'lib/bitstamp.rb', line 54

def self.setup
  yield self
end

.tickerObject



46
47
48
# File 'lib/bitstamp.rb', line 46

def self.ticker
  return Bitstamp::Ticker.from_api
end

.user_transactionsObject



34
35
36
37
38
# File 'lib/bitstamp.rb', line 34

def self.user_transactions
  self.sanity_check!

  @@transactions ||= Bitstamp::UserTransactions.new
end