Class: Pageflow::Admin::FormInput Private

Inherits:
Object
  • Object
show all
Defined in:
lib/pageflow/admin/form_input.rb

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attribute_name, options) ⇒ FormInput

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of FormInput.



7
8
9
10
# File 'lib/pageflow/admin/form_input.rb', line 7

def initialize(attribute_name, options)
  @attribute_name = attribute_name
  @options = options
end

Instance Attribute Details

#attribute_nameObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



5
6
7
# File 'lib/pageflow/admin/form_input.rb', line 5

def attribute_name
  @attribute_name
end

Instance Method Details

#build(form_builder) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



12
13
14
15
# File 'lib/pageflow/admin/form_input.rb', line 12

def build(form_builder)
  options = @options.respond_to?(:call) ? @options.call : @options
  form_builder.input(attribute_name, options)
end