Class: TDAmeritrade::Operations::GetInstrumentFundamentals

Inherits:
BaseOperation
  • Object
show all
Defined in:
lib/tdameritrade/operations/get_instrument_fundamentals.rb

Constant Summary

Constants inherited from BaseOperation

BaseOperation::HTTP_DEBUG_OUTPUT

Instance Attribute Summary

Attributes inherited from BaseOperation

#client

Instance Method Summary collapse

Methods inherited from BaseOperation

#initialize

Methods included from Util

handle_api_error, parse_json_response, response_success?

Constructor Details

This class inherits a constructor from TDAmeritrade::Operations::BaseOperation

Instance Method Details

#call(symbol) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/tdameritrade/operations/get_instrument_fundamentals.rb', line 6

def call(symbol)
  params = {
    apikey: client.client_id,
    symbol: symbol,
    projection: 'fundamental'
  }

  response = perform_api_get_request(
    url: 'https://api.tdameritrade.com/v1/instruments',
    query: params,
  )

  parse_api_response(response)
end