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.



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

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

Instance Attribute Details

#attribute_nameObject

Returns the value of attribute attribute_name.



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

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



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

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