lib/ig_markets/dealing_platform/market_methods.rb
def find(*epics)
        epics = epics.flatten

        return [] if epics.empty?

        epics.each do |epic|
          raise ArgumentError, "invalid EPIC: #{epic}" unless Regex::EPIC.match?(epic.to_s)
        end

        # The API imposes a maximum of 50 EPICs per request
        markets = epics.each_slice(50).map do |epics_slice|
          @dealing_platform.session.get("markets?epics=#{epics_slice.join(',')}", API_V2).fetch :market_details
        end

        @dealing_platform.instantiate_models Market, markets.flatten
      end
# Returns details for the markets with the passed EPICs.
#
# @param [Array<String>] epics The EPICs of the markets to return details for.
#
# @return [Array<Market>]
Returns details for the markets with the passed EPICs.
Returns details for the markets with the passed EPICs .
def find(*epics)
        epics = epics.flatten
        return [] if epics.empty?
        epics.each do |epic|
          raise ArgumentError, "invalid EPIC: #{epic}" unless Regex::EPIC.match?(epic.to_s)
        end
        markets = epics.each_slice(50).map do |epics_slice|
          @dealing_platform.session.get("markets?epics=#{epics_slice.join(',')}", API_V2).fetch :market_details
        end
        @dealing_platform.instantiate_models Market, markets.flatten
      end
def find ( * epics ) epics = epics . flatten return [ ] if epics . empty? epics . each do | epic | raise ArgumentError , "invalid EPIC: #{epic}" unless Regex :: EPIC . match? ( epic . to_s ) end markets = epics . each_slice ( 50 ) . map do | epics_slice | @dealing_platform . session . get ( "markets?epics=#{epics_slice.join(',')}" , API_V2 ) . fetch :market_details end @dealing_platform . instantiate_models Market , markets . flatten end
Returns details for the markets with the passed EPICs.
Returns details for the markets with the passed EPICs .
# The API imposes a maximum of 50 EPICs per request
None
Array<Market>
epics
epics The EPICs of the markets to return details for.
epics The EPICs of the markets to return details for .