📦 SQA::DataFrame::Data¶
Description
Data class to store stock metadata
This class holds metadata about a stock including its ticker symbol, name, exchange, data source, technical indicators, and company overview.
🔨 Instance Methods¶
#ticker()¶
Returns
Type: String, nil
Stock ticker symbol (e.g., 'AAPL', 'MSFT')
Source Location
#ticker=(value)¶
Returns
Type: String, nil
Stock ticker symbol (e.g., 'AAPL', 'MSFT')
Source Location
#name()¶
Returns
Type: String, nil
Company name
Source Location
#name=(value)¶
Returns
Type: String, nil
Company name
Source Location
#exchange()¶
Returns
Type: String, nil
Exchange where stock trades (e.g., 'NASDAQ', 'NYSE')
Source Location
#exchange=(value)¶
Returns
Type: String, nil
Exchange where stock trades (e.g., 'NASDAQ', 'NYSE')
Source Location
#source()¶
Returns
Type: Symbol
Data source (:alpha_vantage, :yahoo_finance)
Source Location
#source=(value)¶
Returns
Type: Symbol
Data source (:alpha_vantage, :yahoo_finance)
Source Location
#indicators()¶
Returns
Type: Hash
Technical indicators configuration and cached values
Source Location
#indicators=(value)¶
Returns
Type: Hash
Technical indicators configuration and cached values
Source Location
#overview()¶
Returns
Type: Hash
Company overview data from API
Source Location
#overview=(value)¶
Sets the attribute overview
Parameters
| Name | Type | Description |
|---|---|---|
value |
Any |
the value to set the attribute overview to. |
Source Location
#initialize(data_hash = nil, ticker: = nil, name: = nil, exchange: = nil, source: = :alpha_vantage, indicators: = {}, overview: = {})¶
Initializes stock metadata.
Can be called in two ways: 1. With a hash: SQA::DataFrame::Data.new(hash) - for JSON deserialization 2. With keyword args: SQA::DataFrame::Data.new(ticker: 'AAPL', source: :alpha_vantage, ...)
Parameters
| Name | Type | Description |
|---|---|---|
data_hash |
Hash, nil |
Hash of all attributes (when passed as first positional arg) |
ticker |
String, Symbol, nil |
Ticker symbol |
name |
String, nil |
Stock name |
exchange |
String, nil |
Exchange symbol (e.g., 'NASDAQ', 'NYSE') |
source |
Symbol |
Data source (:alpha_vantage, :yahoo_finance) |
indicators |
Hash |
Technical indicators configuration |
overview |
Hash |
Company overview data |
Returns
Type: Data
a new instance of Data
Source Location
#to_json(*args)¶
Serialize to JSON string
Returns
Type: String
JSON representation
Source Location
#to_h()¶
Convert to hash
Returns
Type: Hash
Hash representation
Source Location
#to_s()¶
String representation
Returns
Type: String
Human-readable representation
Source Location
#inspect()¶
String representation
Returns
Type: String
Human-readable representation