Module: Yfinrb::Financials

Includes:
ActiveSupport::Inflector
Included in:
Ticker
Defined in:
lib/yfinrb/financials.rb

Class Method Summary collapse

Instance Method Summary collapse

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_sheetObject 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_flowObject 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_stmtObject 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_financialsObject



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_sheetObject 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_flowObject 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_stmtObject 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