Class: FighterBase::Level
- Inherits:
-
Object
- Object
- FighterBase::Level
- Defined in:
- lib/fighter_base/level.rb
Instance Attribute Summary collapse
-
#account ⇒ Object
readonly
Returns the value of attribute account.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#exchange ⇒ Object
readonly
Returns the value of attribute exchange.
Instance Method Summary collapse
- #heartbeat ⇒ Object
-
#initialize(api_key, account, venue_symbol) ⇒ Level
constructor
A new instance of Level.
Constructor Details
Instance Attribute Details
#account ⇒ Object (readonly)
Returns the value of attribute account.
5 6 7 |
# File 'lib/fighter_base/level.rb', line 5 def account @account end |
#api_key ⇒ Object (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 |
#exchange ⇒ Object (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
#heartbeat ⇒ Object
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 |