Class: FighterBase::Level

Inherits:
Object
  • Object
show all
Defined in:
lib/fighter_base/level.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key, account, venue_symbol) ⇒ Level

Returns a new instance of Level.



7
8
9
10
11
# File 'lib/fighter_base/level.rb', line 7

def initialize(api_key, , venue_symbol)
    @api_key = api_key
    @account = 
    @exchange = Exchange.new(venue_symbol, self)
end

Instance Attribute Details

#accountObject (readonly)

Returns the value of attribute account.



5
6
7
# File 'lib/fighter_base/level.rb', line 5

def 
  @account
end

#api_keyObject (readonly)

Returns the value of attribute api_key.



5
6
7
# File 'lib/fighter_base/level.rb', line 5

def api_key
  @api_key
end

#exchangeObject (readonly)

Returns the value of attribute exchange.



5
6
7
# File 'lib/fighter_base/level.rb', line 5

def exchange
  @exchange
end

Instance Method Details

#heartbeatObject



13
14
15
16
17
18
19
# File 'lib/fighter_base/level.rb', line 13

def heartbeat
    response = HTTParty.get("https://api.stockfighter.io/ob/api/heartbeat")
    ok = response.parsed_response["ok"] rescue false

    raise "World is on fire!" unless ok
    puts "lump lump, lump lump" if ok
end