Class: Alphavcli::Apicaller

Inherits:
Object
  • Object
show all
Defined in:
lib/alphavcli/apicaller.rb

Instance Method Summary collapse

Constructor Details

#initializeApicaller

Returns a new instance of Apicaller.



5
6
7
# File 'lib/alphavcli/apicaller.rb', line 5

def initialize
    @@URL_ROOT="https://www.alphavantage.co/query?pikey=#{Alphavcli::APIKEY}"
end

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