Sha256: a8324bb353137a524ac8ae5e9e68a379ebf8fa3ff3dc26f5124e100c052e0151

Contents?: true

Size: 397 Bytes

Versions: 9

Compression:

Stored size: 397 Bytes

Contents

class StockIndex

  def initialize(symbol)
    @symbol = symbol
  end

  def components
    case @symbol
      when '^DJI'
        DjiScraper.new.scrape
      when '^GSPC'
        SP500Scraper.new.scrape
      when '^NDX'
        NasdaqScraper.new.scrape
      when '^N225'
        NikkeiScraper.new.scrape
      when '^FTSE'
        FtseScraper.new.scrape
      else
        []
    end
  end

end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
stock_index-0.8.8 lib/stock_index/stock_index.rb
stock_index-0.8.7 lib/stock_index/stock_index.rb
stock_index-0.8.6 lib/stock_index/stock_index.rb
stock_index-0.8.5 lib/stock_index/stock_index.rb
stock_index-0.8.4 lib/stock_index/stock_index.rb
stock_index-0.8.3 lib/stock_index/stock_index.rb
stock_index-0.8.2 lib/stock_index/stock_index.rb
stock_index-0.8.1 lib/stock_index/stock_index.rb
stock_index-0.8.0 lib/stock_index/stock_index.rb