lib/ig_markets/position.rb
# Runs a series of validations on this model's attributes to check whether it is ready to be sent to the IG
# Markets API.
Runs a series of validations on this model's attributes to check whether it is ready to be sent to the IG
Markets API.
Runs a series of validations on this model ' s attributes to check whether it is ready to be sent to the IG Markets API .
def validate
        %i[deal_id direction order_type size time_in_force].each do |attribute|
          raise ArgumentError, "#{attribute} attribute must be set" if attributes[attribute].nil?
        end
        Position.validate_order_type_constraints attributes
      end
def validate %i[ deal_id direction order_type size time_in_force ] . each do | attribute | raise ArgumentError , "#{attribute} attribute must be set" if attributes [ attribute ] . nil? end Position . validate_order_type_constraints attributes end
Runs a series of validations on this model's attributes to check whether it is ready to be sent to the IG
Markets API.
Runs a series of validations on this model ' s attributes to check whether it is ready to be sent to the IG Markets API .