Module: MyTradeWizard::DateTime
- Included in:
- TradingSystem
- Defined in:
- lib/mytradewizard/date_time.rb
Constant Summary collapse
- HR =
360
Instance Method Summary collapse
Instance Method Details
#at(hour, minute) ⇒ Object
6 7 8 9 10 11 12 13 14 |
# File 'lib/mytradewizard/date_time.rb', line 6 def at(hour, minute) unless MyTradeWizard::Configuration::ENVIRONMENT == 'local' print "Waiting until #{hour}:#{minute} ..." until time_is(hour, minute) sleep 60 print '.' end end end |
#friday ⇒ Object
20 21 22 |
# File 'lib/mytradewizard/date_time.rb', line 20 def friday Time.now.utc.wday == 5 end |
#idle(seconds) ⇒ Object
16 17 18 |
# File 'lib/mytradewizard/date_time.rb', line 16 def idle(seconds) sleep(seconds) unless MyTradeWizard::Configuration::ENVIRONMENT == 'local' end |