Stock data provided by Alpha Vantage. An API KEY is required.
To install the 'algonquin_stocks' ruby gem:
gem install algonquin_stocks
To use the gem in your Rails Application, include it in your Gemfile:
gem "algonquin_stocks", "~> 2.1.0"
To initialize AlgonquinStocks with a valid API_KEY:
AlgonquinStocks::StockClient.new YOUR_API_KEY, CACHE
CACHE is optional and defaults to false. If set to true, the gem will cache the stock data in a SQLite database.
Quote is the primary method, returning a AlgonquinStocks::Stock instance including the following attributes:
- symbol
- open
- high
- low
- price
- volume
- date
- close
- change
- percent
- data
Data returns a hash representation of the JSON data.
Stock.new(json) initializes a new AlgonquinStocks::Stock instance with the given JSON data.
Update updates the AlgonquinStocks::Stock instance with the given JSON data.
to_s returns a string representation of the AlgonquinStocks::Stock instance.