Class: Alpharb::Client
- Inherits:
-
Object
- Object
- Alpharb::Client
- Defined in:
- lib/alpharb/client.rb
Constant Summary collapse
- API_ENDPOINT =
'https://www.alphavantage.co'.freeze
Instance Attribute Summary collapse
-
#token ⇒ Object
readonly
Returns the value of attribute token.
Instance Method Summary collapse
-
#initialize(token = nil) ⇒ Client
constructor
A new instance of Client.
- #quote(symbol) ⇒ Object
- #search(keywords) ⇒ Object
Constructor Details
#initialize(token = nil) ⇒ Client
Returns a new instance of Client.
7 8 9 |
# File 'lib/alpharb/client.rb', line 7 def initialize(token = nil) @token = token end |
Instance Attribute Details
#token ⇒ Object (readonly)
Returns the value of attribute token.
5 6 7 |
# File 'lib/alpharb/client.rb', line 5 def token @token end |
Instance Method Details
#quote(symbol) ⇒ Object
15 16 17 |
# File 'lib/alpharb/client.rb', line 15 def quote(symbol) request params: { function: 'GLOBAL_QUOTE', symbol: symbol } end |
#search(keywords) ⇒ Object
11 12 13 |
# File 'lib/alpharb/client.rb', line 11 def search(keywords) request params: { function: 'SYMBOL_SEARCH', keywords: keywords } end |