Class: Alphavcli::Apicaller
- Inherits:
-
Object
- Object
- Alphavcli::Apicaller
- Defined in:
- lib/alphavcli/apicaller.rb
Instance Method Summary collapse
-
#initialize ⇒ Apicaller
constructor
A new instance of Apicaller.
- #search(qurery) ⇒ Object
Constructor Details
Instance Method Details
#search(qurery) ⇒ Object
8 9 10 11 12 13 |
# File 'lib/alphavcli/apicaller.rb', line 8 def search(qurery) puts @@URL_ROOT+"query?function=SYMBOL_SEARCH&keywords=#{query}" data = open(@@URL_ROOT+"query?function=SYMBOL_SEARCH&keywords=#{query}") #data = open("https://www.alphavantage.co/query?function=SYMBOL_SEARCH&keywords=#{@query}&apikey=#{Alphavcli::APIKEY}").read #data = JSON.parse(data) end |