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

Defined Under Namespace

Modules: Helper, Net Classes: Collection, MissingConfigExecption, Model, Order, Orders, Ticker

Constant Summary collapse

@@currency =
:usd

Class Method Summary collapse

Class Method Details

.balanceObject



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

def self.balance
  self.sanity_check!

  JSON.parse Bitstamp::Net.get('/balance').body_str
end

.ordersObject



27
28
29
30
31
# File 'lib/bitstamp.rb', line 27

def self.orders
  self.sanity_check!

  @@orders ||= Bitstamp::Orders.new
end

.sanity_check!Object



47
48
49
50
51
# File 'lib/bitstamp.rb', line 47

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



43
44
45
# File 'lib/bitstamp.rb', line 43

def self.setup
  yield self
end

.tickerObject



39
40
41
# File 'lib/bitstamp.rb', line 39

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