Class: FilterForm::InputOptionsBuilder

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ InputOptionsBuilder

Returns a new instance of InputOptionsBuilder.



17
18
19
20
21
22
# File 'lib/filter_form/input_options_builder.rb', line 17

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

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name.



15
16
17
# File 'lib/filter_form/input_options_builder.rb', line 15

def attribute_name
  @attribute_name
end

#custom_predicateObject

Returns the value of attribute custom_predicate.



15
16
17
# File 'lib/filter_form/input_options_builder.rb', line 15

def custom_predicate
  @custom_predicate
end

#custom_typeObject

Returns the value of attribute custom_type.



15
16
17
# File 'lib/filter_form/input_options_builder.rb', line 15

def custom_type
  @custom_type
end

#objectObject

Returns the value of attribute object.



15
16
17
# File 'lib/filter_form/input_options_builder.rb', line 15

def object
  @object
end

Instance Method Details

#build(options = {}) ⇒ Object



25
26
27
# File 'lib/filter_form/input_options_builder.rb', line 25

def build(options = {})
  input_options_class.new(attribute_name: attribute_name, object: object, custom_predicate: custom_predicate, options: options).simple_form_options
end