Module: Bitstamp

Defined in:
lib/bitstamp.rb,
lib/bitstamp/net.rb,
lib/bitstamp/model.rb,
lib/bitstamp/orders.rb,
lib/bitstamp/collection.rb

Defined Under Namespace

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

Constant Summary collapse

@@currency =
:usd

Class Method Summary collapse

Class Method Details

.balanceObject



31
32
33
34
35
# File 'lib/bitstamp.rb', line 31

def self.balance
  self.sanity_check!

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

.ordersObject



25
26
27
28
29
# File 'lib/bitstamp.rb', line 25

def self.orders
  self.sanity_check!

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

.sanity_check!Object



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

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



37
38
39
# File 'lib/bitstamp.rb', line 37

def self.setup
  yield self
end