Class: Alphavantage::Fundamental

Inherits:
Object
  • Object
show all
Defined in:
lib/alphavantage/fundamental.rb

Constant Summary collapse

FUNCTIONS =
{
  overview: 'OVERVIEW',
  earnings: 'EARNINGS',
  income_statement: 'INCOME_STATEMENT',
  balance_sheet: 'BALANCE_SHEET',
  cash_flow: 'CASH_FLOW'
}

Instance Method Summary collapse

Constructor Details

#initialize(symbol:) ⇒ Fundamental

Returns a new instance of Fundamental.



11
12
13
# File 'lib/alphavantage/fundamental.rb', line 11

def initialize(symbol:)
  @symbol = symbol
end

Instance Method Details

#balance_sheetObject



27
28
29
# File 'lib/alphavantage/fundamental.rb', line 27

def balance_sheet
  response(FUNCTIONS[__method__]).annual_reports
end

#cash_flowObject



31
32
33
# File 'lib/alphavantage/fundamental.rb', line 31

def cash_flow
  response(FUNCTIONS[__method__]).annual_reports
end

#earningsObject



19
20
21
# File 'lib/alphavantage/fundamental.rb', line 19

def earnings
  response(FUNCTIONS[__method__]).annual_earnings
end

#income_statementObject



23
24
25
# File 'lib/alphavantage/fundamental.rb', line 23

def income_statement
  response(FUNCTIONS[__method__]).annual_reports
end

#overviewObject



15
16
17
# File 'lib/alphavantage/fundamental.rb', line 15

def overview
  response(FUNCTIONS[__method__])
end