Skip to content

📦 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.

Source Information

Defined in: lib/sqa/data_frame/data.rb:23

Inherits from: Object

🔨 Instance Methods

#ticker()

Returns

Type: String, nil

Stock ticker symbol (e.g., 'AAPL', 'MSFT')

Source Location

lib/sqa/data_frame/data.rb:36


#ticker=(value)

Returns

Type: String, nil

Stock ticker symbol (e.g., 'AAPL', 'MSFT')

Source Location

lib/sqa/data_frame/data.rb:36


#name()

Returns

Type: String, nil

Company name

Source Location

lib/sqa/data_frame/data.rb:36


#name=(value)

Returns

Type: String, nil

Company name

Source Location

lib/sqa/data_frame/data.rb:36


#exchange()

Returns

Type: String, nil

Exchange where stock trades (e.g., 'NASDAQ', 'NYSE')

Source Location

lib/sqa/data_frame/data.rb:36


#exchange=(value)

Returns

Type: String, nil

Exchange where stock trades (e.g., 'NASDAQ', 'NYSE')

Source Location

lib/sqa/data_frame/data.rb:36


#source()

Returns

Type: Symbol

Data source (:alpha_vantage, :yahoo_finance)

Source Location

lib/sqa/data_frame/data.rb:36


#source=(value)

Returns

Type: Symbol

Data source (:alpha_vantage, :yahoo_finance)

Source Location

lib/sqa/data_frame/data.rb:36


#indicators()

Returns

Type: Hash

Technical indicators configuration and cached values

Source Location

lib/sqa/data_frame/data.rb:36


#indicators=(value)

Returns

Type: Hash

Technical indicators configuration and cached values

Source Location

lib/sqa/data_frame/data.rb:36


#overview()

Returns

Type: Hash

Company overview data from API

Source Location

lib/sqa/data_frame/data.rb:36


#overview=(value)

Sets the attribute overview

Parameters

Name Type Description
value Any the value to set the attribute overview to.
Source Location

lib/sqa/data_frame/data.rb:36


#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

lib/sqa/data_frame/data.rb:52


#to_json(*args)

Serialize to JSON string

Returns

Type: String

JSON representation

Source Location

lib/sqa/data_frame/data.rb:78


#to_h()

Convert to hash

Returns

Type: Hash

Hash representation

Source Location

lib/sqa/data_frame/data.rb:85


#to_s()

String representation

Returns

Type: String

Human-readable representation

Source Location

lib/sqa/data_frame/data.rb:99


#inspect()

String representation

Returns

Type: String

Human-readable representation

Source Location

lib/sqa/data_frame/data.rb:102


📝 Attributes

🔄 ticker read/write

🔄 name read/write

🔄 exchange read/write

🔄 source read/write

🔄 indicators read/write

🔄 overview read/write