Class: UrlFormatter
- Inherits:
-
Object
- Object
- UrlFormatter
- Defined in:
- lib/finviz_rails/url_formatter.rb
Instance Method Summary collapse
-
#initialize(auth, page, params, row_limit) ⇒ UrlFormatter
constructor
A new instance of UrlFormatter.
- #run ⇒ Object
Constructor Details
#initialize(auth, page, params, row_limit) ⇒ UrlFormatter
Returns a new instance of UrlFormatter.
2 3 4 5 6 7 |
# File 'lib/finviz_rails/url_formatter.rb', line 2 def initialize(auth, page, params, row_limit) @auth = auth @page = page @params = params @row_limit = row_limit end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/finviz_rails/url_formatter.rb', line 9 def run if @page stock_num = ((@page * @row_limit) + 1) - @row_limit else stock_num = 0 end "#{url}&r=#{stock_num}" end |