Sha256: 24acdadad136572c66932153229daaede702f7fec7991e15e10769f87871f661

Contents?: true

Size: 484 Bytes

Versions: 4

Compression:

Stored size: 484 Bytes

Contents

module LatestStockPrice
  class Price
    API_BASE_URL = "https://latest-stock-price.p.rapidapi.com/equities-search"

    def self.fetch(search_term) # Param example - "AAATECH.NS"
      raise ArgumentError, "Search term cannot be nil or empty" if search_term.nil? || search_term.strip.empty?

      encoded_term = URI.encode_www_form_component(search_term)
      uri = URI("#{API_BASE_URL}?Search=#{encoded_term}")
			LatestStockPrice::HttpClient.make_request(uri)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
latest_stock_price-1.0.3 lib/price.rb
latest_stock_price-1.0.2 lib/price.rb
latest_stock_price-1.0.1 lib/price.rb
latest_stock_price-1.0.0 lib/latest_stock_price/price.rb