Class: Tableficate::Filter::SelectRange

Inherits:
Base
  • Object
show all
Defined in:
lib/tableficate/filters/select_range.rb

Instance Attribute Summary collapse

Attributes inherited from Base

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

Instance Method Summary collapse

Methods inherited from Base

#field_value

Constructor Details

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

Returns a new instance of SelectRange.



38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/tableficate/filters/select_range.rb', line 38

def initialize(table, name, options = {})
  start_options = options.delete(:start) || {}
  stop_options  = options.delete(:stop)  || {}

  super(table, name, options)

  start_options.reverse_merge!(@attrs)
  start_options.reverse_merge!(label: self.label, label_options: self.label_options)
  stop_options.reverse_merge!(@attrs)
  stop_options.reverse_merge!(label: self.label, label_options: self.label_options)

  @start = SelectStart.new(table, name, start_options)
  @stop  = SelectStop.new(table, name, stop_options)
end

Instance Attribute Details

#startObject (readonly)

Returns the value of attribute start.



36
37
38
# File 'lib/tableficate/filters/select_range.rb', line 36

def start
  @start
end

#stopObject (readonly)

Returns the value of attribute stop.



36
37
38
# File 'lib/tableficate/filters/select_range.rb', line 36

def stop
  @stop
end