Class: FilterDecrufter::Hit

Inherits:
Object
  • Object
show all
Defined in:
lib/filter_decrufter/checker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(controller_class, filter_name, options, filter_type) ⇒ Hit

Returns a new instance of Hit.



7
8
9
10
11
12
# File 'lib/filter_decrufter/checker.rb', line 7

def initialize(controller_class, filter_name, options, filter_type)
  @controller_class = controller_class
  @filter_name = filter_name
  @options = options
  @filter_type = filter_type
end

Instance Attribute Details

#controller_classObject

Returns the value of attribute controller_class.



5
6
7
# File 'lib/filter_decrufter/checker.rb', line 5

def controller_class
  @controller_class
end

#filter_nameObject

Returns the value of attribute filter_name.



5
6
7
# File 'lib/filter_decrufter/checker.rb', line 5

def filter_name
  @filter_name
end

#filter_typeObject

Returns the value of attribute filter_type.



5
6
7
# File 'lib/filter_decrufter/checker.rb', line 5

def filter_type
  @filter_type
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/filter_decrufter/checker.rb', line 5

def options
  @options
end

Instance Method Details

#actions_include?(action_name) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/filter_decrufter/checker.rb', line 14

def actions_include?(action_name)
  action_methods.include?(action_name)
end

#populated_options_for(name) ⇒ Object



18
19
20
# File 'lib/filter_decrufter/checker.rb', line 18

def populated_options_for(name)
  options.select {|opt_name,opt_value| opt_name == name && !opt_value.empty? }
end