Class: Storefront::Components::Form::Base

Inherits:
Base
  • Object
show all
Includes:
Helpers::ContentHelper, Helpers::DomHelper
Defined in:
lib/storefront/components/form/base.rb

Direct Known Subclasses

Builder, Errors, Fieldset, Hint, Input, Label

Constant Summary

Constant Summary

Constants included from Helpers::ContentHelper

Helpers::ContentHelper::SCOPES, Helpers::ContentHelper::SCOPES_WITH_NAMESPACE, Helpers::ContentHelper::SCOPES_WITH_NAMESPACE_AND_NESTED_MODEL, Helpers::ContentHelper::SCOPES_WITH_NESTED_MODEL

Instance Attribute Summary

Attributes inherited from Base

#options

Instance Method Summary (collapse)

Methods included from Helpers::DomHelper

#aria, #clone_attributes, #dom, #index_class, #merge_class, #merge_class!, #page, #resource_to_title, #title_widget, #title_widget_options

Methods included from Helpers::ContentHelper

#encoded_contents, #font_face_data_uri, #html5_time, #read_binary_file, #read_image_size, #rendered_text, #sanitize, #t?

Methods inherited from Base

#component_name, #extract_classes!, #extract_options!, #inside?, #pointer, #render, #render_with_pointer, #to_s

Constructor Details

- (Base) initialize(options = {})

Returns a new instance of Base



8
9
10
11
12
13
14
15
16
17
# File 'lib/storefront/components/form/base.rb', line 8

def initialize(options = {})
  @template       = options[:template]
  @model          = options[:model]
  @attribute      = options[:attribute]
  @parent_index   = options[:parent_index]
  @index          = options[:index]
  @tabindex       = options[:tabindex]
  @access_keys    = options[:access_keys]
  @attributes     = clone_attributes(options.except(:template, :model, :attribute, :access_keys, :index, :tabindex))
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Storefront::Components::Base