Class: Indices
- Inherits:
-
Object
- Object
- Indices
- Defined in:
- lib/finviz_rails/indices.rb
Instance Method Summary collapse
-
#initialize(agent, auth, *params) ⇒ Indices
constructor
A new instance of Indices.
- #run ⇒ Object
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
#run ⇒ Object
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 |