Class: ActionView::Helpers::Tags::CollectionHelpers::Builder

Inherits:
Object
  • Object
show all
Defined in:
actionview/lib/action_view/helpers/tags/collection_helpers.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(template_object, object_name, method_name, object, sanitized_attribute_name, text, value, input_html_options) ⇒ Builder

Returns a new instance of Builder.



8
9
10
11
12
13
14
15
16
17
18
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 8

def initialize(template_object, object_name, method_name, object,
               sanitized_attribute_name, text, value, input_html_options)
  @template_object = template_object
  @object_name = object_name
  @method_name = method_name
  @object = object
  @sanitized_attribute_name = sanitized_attribute_name
  @text = text
  @value = value
  @input_html_options = input_html_options
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object



6
7
8
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 6

def object
  @object
end

#textObject (readonly)

Returns the value of attribute text



6
7
8
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 6

def text
  @text
end

#valueObject (readonly)

Returns the value of attribute value



6
7
8
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 6

def value
  @value
end

Instance Method Details

#label(label_html_options = {}, &block) ⇒ Object



20
21
22
23
# File 'actionview/lib/action_view/helpers/tags/collection_helpers.rb', line 20

def label(label_html_options={}, &block)
  html_options = @input_html_options.slice(:index, :namespace).merge(label_html_options)
  @template_object.label(@object_name, @sanitized_attribute_name, @text, html_options, &block)
end