Class: Indices

Inherits:
Object
  • Object
show all
Defined in:
lib/finviz_rails/indices.rb

Instance Method Summary collapse

Constructor Details

#initialize(agent, auth, *params) ⇒ Indices

Returns a new instance of Indices.



2
3
4
5
6
# File 'lib/finviz_rails/indices.rb', line 2

def initialize(agent, auth, *params)
  @agent = agent
  @auth = auth
  @results = {}
end

Instance Method Details

#runObject



8
9
10
11
12
13
14
15
16
# File 'lib/finviz_rails/indices.rb', line 8

def run
  @agent.get(url)
  matches.map do |match|
    indice = get_indice(match.first)
    percent_change = get_percent(match.first)
    @results[indice] = percent_change
  end
  @results
end