Class: Finviz

Inherits:
Object
  • Object
show all
Includes:
HTTParty
Defined in:
lib/finviz_rails/finviz.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(username = nil, password = nil) ⇒ Finviz

Returns a new instance of Finviz.



9
10
11
12
13
# File 'lib/finviz_rails/finviz.rb', line 9

def initialize(username=nil, password=nil)
  @username = ENV['FINVIZ_USERNAME'] || username
  @password = ENV['FINVIZ_PASSWORD'] || password
   if @username && @password
end

Instance Attribute Details

#authenticatedObject

Returns the value of attribute authenticated.



7
8
9
# File 'lib/finviz_rails/finviz.rb', line 7

def authenticated
  @authenticated
end

Instance Method Details

#indicesObject



19
20
21
# File 'lib/finviz_rails/finviz.rb', line 19

def indices
  Indices.new(agent, @authenticated).run
end

#screener(params) ⇒ Object



15
16
17
# File 'lib/finviz_rails/finviz.rb', line 15

def screener(params)
  Screener.new(agent, @authenticated, params).run
end

#series(symbol, params) ⇒ Object



27
28
29
# File 'lib/finviz_rails/finviz.rb', line 27

def series(symbol, params)
  Series.new(symbol, params, agent).run
end

#url(params) ⇒ Object



23
24
25
# File 'lib/finviz_rails/finviz.rb', line 23

def url(params)
  UrlFormatter.new(nil, nil, params, nil).run
end