Class: IGMarkets::CLI::Sprints
- Inherits:
-
Thor
- Object
- Thor
- IGMarkets::CLI::Sprints
- Defined in:
- lib/ig_markets/cli/commands/sprints_command.rb
Overview
Implements the ‘ig_markets sprints` command.
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
28 29 30 31 32 33 34 |
# File 'lib/ig_markets/cli/commands/sprints_command.rb', line 28 def create Main.begin_session() do |dealing_platform| deal_reference = dealing_platform.sprint_market_positions.create sprint_market_position_attributes Main.report_deal_confirmation deal_reference end end |
#list ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/ig_markets/cli/commands/sprints_command.rb', line 7 def list Main.begin_session() do |dealing_platform| sprints = dealing_platform.sprint_market_positions.all markets = dealing_platform.markets.find sprints.map(&:epic).uniq table = Tables::SprintMarketPositionsTable.new sprints, markets: markets puts table end end |