Module: Yfinrb::Financials
Class Method Summary collapse
-
.included(base) ⇒ Object
built-in Ruby hook for modules.
Instance Method Summary collapse
- #balance_sheet ⇒ Object (also: #annual_balance_sheet, #annual_balancesheet)
- #cash_flow ⇒ Object (also: #cashflow, #annual_cashflow, #annual_cash_flow)
- #income_stmt ⇒ Object (also: #annual_incomestmt, #annual_income_stmt, #annual_financials)
- #initialize_financials ⇒ Object
- #quarterly_balance_sheet ⇒ Object (also: #quarterly_balancesheet)
- #quarterly_cash_flow ⇒ Object (also: #quarterly_cashflow)
- #quarterly_income_stmt ⇒ Object (also: #quarterly_incomestmt, #quarterly_financials)
Class Method Details
.included(base) ⇒ Object
built-in Ruby hook for modules
7 8 9 10 11 12 13 14 15 |
# File 'lib/yfinrb/financials.rb', line 7 def self.included(base) # built-in Ruby hook for modules base.class_eval do original_method = instance_method(:initialize) define_method(:initialize) do |*args, &block| original_method.bind(self).call(*args, &block) initialize_financials # (your module code here) end end end |
Instance Method Details
#balance_sheet ⇒ Object Also known as: annual_balance_sheet, annual_balancesheet
31 |
# File 'lib/yfinrb/financials.rb', line 31 def balance_sheet; _get_balance_sheet(pretty: true); end |
#cash_flow ⇒ Object Also known as: cashflow, annual_cashflow, annual_cash_flow
37 |
# File 'lib/yfinrb/financials.rb', line 37 def cash_flow; _get_cash_flow(pretty: true, freq: 'yearly'); end |
#income_stmt ⇒ Object Also known as: annual_incomestmt, annual_income_stmt, annual_financials
23 |
# File 'lib/yfinrb/financials.rb', line 23 def income_stmt; _get_income_stmt(pretty: true); end |
#initialize_financials ⇒ Object
17 18 19 20 21 |
# File 'lib/yfinrb/financials.rb', line 17 def initialize_financials @income_time_series = {} @balance_sheet_time_series = {} @cash_flow_time_series = {} end |
#quarterly_balance_sheet ⇒ Object Also known as: quarterly_balancesheet
32 |
# File 'lib/yfinrb/financials.rb', line 32 def quarterly_balance_sheet; _get_balance_sheet(pretty: true, freq: 'quarterly'); end |
#quarterly_cash_flow ⇒ Object Also known as: quarterly_cashflow
39 |
# File 'lib/yfinrb/financials.rb', line 39 def quarterly_cash_flow; _get_cash_flow(pretty: true, freq: 'quarterly'); end |
#quarterly_income_stmt ⇒ Object Also known as: quarterly_incomestmt, quarterly_financials
24 |
# File 'lib/yfinrb/financials.rb', line 24 def quarterly_income_stmt; _get_income_stmt(pretty: true, freq: 'quarterly'); end |