Class: ActionView::Helpers::AttributeBuilders::Base
- Inherits:
-
Object
- Object
- ActionView::Helpers::AttributeBuilders::Base
- Includes:
- FormOptionsHelper, Helpers::ActiveModelInstanceTag, Helpers::FormTagHelper
- Defined in:
- lib/actionview_attribute_builders/attribute_builders/base.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
Instance Method Summary collapse
-
#html_attributes ⇒ Object
This is what child classes implement.
-
#initialize(object_name, method_name, template_object, options = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(object_name, method_name, template_object, options = {}) ⇒ Base
Returns a new instance of Base.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/actionview_attribute_builders/attribute_builders/base.rb', line 12 def initialize(object_name, method_name, template_object, = {}) @object_name, @method_name = object_name.to_s.dup, method_name.to_s.dup @template_object = template_object @object_name.sub!(/\[\]$/, "") || @object_name.sub!(/\[\]\]$/, "]") @object = retrieve_object(.delete(:object)) @skip_default_ids = .delete(:skip_default_ids) @allow_method_names_outside_object = .delete(:allow_method_names_outside_object) = if Regexp.last_match @generate_indexed_names = true @auto_index = retrieve_autoindex(Regexp.last_match.pre_match) else @generate_indexed_names = false @auto_index = nil end end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
10 11 12 |
# File 'lib/actionview_attribute_builders/attribute_builders/base.rb', line 10 def object @object end |
Instance Method Details
#html_attributes ⇒ Object
This is what child classes implement.
32 33 34 |
# File 'lib/actionview_attribute_builders/attribute_builders/base.rb', line 32 def html_attributes raise NotImplementedError, "Subclasses must implement a render method" end |