Class: FilterForm::InputOptions::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/filter_form/input_options/base.rb

Constant Summary collapse

DEFAULT_PREDICATE =
nil
PREDICATE_IN =
:in

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Base

Returns a new instance of Base.



9
10
11
12
13
14
# File 'lib/filter_form/input_options/base.rb', line 9

def initialize(options)
  @attribute_name = options[:attribute_name]
  @object = options[:object]
  @custom_predicate = options[:custom_predicate]
  @options = options[:options]
end

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name.



7
8
9
# File 'lib/filter_form/input_options/base.rb', line 7

def attribute_name
  @attribute_name
end

#custom_predicateObject

Returns the value of attribute custom_predicate.



7
8
9
# File 'lib/filter_form/input_options/base.rb', line 7

def custom_predicate
  @custom_predicate
end

#objectObject

Returns the value of attribute object.



7
8
9
# File 'lib/filter_form/input_options/base.rb', line 7

def object
  @object
end

#optionsObject

Returns the value of attribute options.



7
8
9
# File 'lib/filter_form/input_options/base.rb', line 7

def options
  @options
end

Instance Method Details

#simple_form_optionsObject



16
17
18
# File 'lib/filter_form/input_options/base.rb', line 16

def simple_form_options
  default_options.merge(additional_options).merge(options)
end