Class: IGMarkets::DealingPlatform::SprintMarketPositionMethods
- Inherits:
-
Object
- Object
- IGMarkets::DealingPlatform::SprintMarketPositionMethods
- Defined in:
- lib/ig_markets/dealing_platform/sprint_market_position_methods.rb
Overview
Provides methods for working with sprint market positions. Returned by #sprint_market_positions.
Defined Under Namespace
Classes: SprintMarketPositionCreateAttributes
Instance Method Summary collapse
-
#all ⇒ Array<SprintMarketPosition>
Returns all sprint market positions.
-
#create(attributes) ⇒ String
Creates a new sprint market position.
-
#initialize(dealing_platform) ⇒ SprintMarketPositionMethods
constructor
Initializes this helper class with the specified dealing platform.
Constructor Details
#initialize(dealing_platform) ⇒ SprintMarketPositionMethods
Initializes this helper class with the specified dealing platform.
8 9 10 |
# File 'lib/ig_markets/dealing_platform/sprint_market_position_methods.rb', line 8 def initialize(dealing_platform) @dealing_platform = dealing_platform end |
Instance Method Details
#all ⇒ Array<SprintMarketPosition>
Returns all sprint market positions.
15 16 17 |
# File 'lib/ig_markets/dealing_platform/sprint_market_position_methods.rb', line 15 def all @dealing_platform.gather 'positions/sprintmarkets', :sprint_market_positions, SprintMarketPosition end |
#create(attributes) ⇒ String
Creates a new sprint market position.
30 31 32 33 34 |
# File 'lib/ig_markets/dealing_platform/sprint_market_position_methods.rb', line 30 def create(attributes) payload = PayloadFormatter.format SprintMarketPositionCreateAttributes.new attributes @dealing_platform.session.post('positions/sprintmarkets', payload, API_V1).fetch(:deal_reference) end |