Class: Tableficate::Filter::InputStop

Inherits:
Input
  • Object
show all
Defined in:
lib/tableficate/filters/input_range.rb

Instance Attribute Summary

Attributes inherited from Base

#attrs, #field_name, #label, #label_options, #table, #template

Instance Method Summary collapse

Constructor Details

#initialize(table, name, options = {}) ⇒ InputStop

Returns a new instance of InputStop.



20
21
22
23
24
# File 'lib/tableficate/filters/input_range.rb', line 20

def initialize(table, name, options = {})
  super(table, name, options)

  @field_name += '[stop]'
end

Instance Method Details

#field_value(params) ⇒ Object



30
31
32
# File 'lib/tableficate/filters/input_range.rb', line 30

def field_value(params)
  params[:filter][@name][:stop] rescue ''
end

#nameObject



26
27
28
# File 'lib/tableficate/filters/input_range.rb', line 26

def name
  "#{@name}_stop".to_sym
end