class Finviz::Quotes

The result of the quotes request

Public Instance Methods

add_quote_from_xpath(ticker_xpath, table_xpath) click to toggle source
# File lib/finviz/quotes.rb, line 6
def add_quote_from_xpath(ticker_xpath, table_xpath)
  ticker = ticker_xpath.children.text.downcase
  stats = table_xpath
          .css(".table-dark-row")
          .map { |row| row.css("td").map(&:text) }
          .flatten
          .each_slice(2)
  self[ticker] = Quote.new ticker: ticker, stats: stats
end
to_h() click to toggle source
Calls superclass method
# File lib/finviz/quotes.rb, line 16
def to_h
  super.transform_values(&:to_h)
end