Class: SimpleFormRansack::InputManipulator
- Inherits:
-
Object
- Object
- SimpleFormRansack::InputManipulator
- Defined in:
- lib/simple_form_ransack/input_manipulator.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Instance Method Summary collapse
- #attribute_name ⇒ Object
-
#initialize(args) ⇒ InputManipulator
constructor
A new instance of InputManipulator.
Constructor Details
#initialize(args) ⇒ InputManipulator
Returns a new instance of InputManipulator.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/simple_form_ransack/input_manipulator.rb', line 4 def initialize(args) @args = args.fetch(:args) @name = args.fetch(:name) @params = args.fetch(:params) @class = args.fetch(:class) if @args.last.is_a?(Hash) @opts = @args.pop else @opts = {} end @input_html = @opts[:input_html] || {} calculate_name calculate_as set_values set_max_length end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
2 3 4 |
# File 'lib/simple_form_ransack/input_manipulator.rb', line 2 def args @args end |
Instance Method Details
#attribute_name ⇒ Object
25 26 27 |
# File 'lib/simple_form_ransack/input_manipulator.rb', line 25 def attribute_name @attribute_name || @name end |