Class: FilterMapper

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

Instance Method Summary collapse

Constructor Details

#initialize(*params) ⇒ FilterMapper

Returns a new instance of FilterMapper.



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

def initialize(*params)
  @params = params.first
  @param_components = []
end

Instance Method Details

#runObject



7
8
9
10
11
12
# File 'lib/finviz_rails/filter_mapper.rb', line 7

def run
  mapper.each do |key, value|
    @param_components << "#{value}_#{@params[key]}" if @params[key]
  end
  @param_components.join(",")
end