Class: Superform::Rails::Components::BaseComponent
- Inherits:
-
Superform::Rails::Component
- Object
- Superform::Rails::Components::BaseComponent
- Defined in:
- lib/superform/rails.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#dom ⇒ Object
readonly
Returns the value of attribute dom.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
Instance Method Summary collapse
- #field_attributes ⇒ Object
- #focus(value = true) ⇒ Object
-
#initialize(field, attributes: {}) ⇒ BaseComponent
constructor
A new instance of BaseComponent.
Constructor Details
#initialize(field, attributes: {}) ⇒ BaseComponent
Returns a new instance of BaseComponent.
206 207 208 209 |
# File 'lib/superform/rails.rb', line 206 def initialize(field, attributes: {}) @field = field @attributes = attributes end |
Instance Attribute Details
#dom ⇒ Object (readonly)
Returns the value of attribute dom.
202 203 204 |
# File 'lib/superform/rails.rb', line 202 def dom @dom end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
202 203 204 |
# File 'lib/superform/rails.rb', line 202 def field @field end |
Instance Method Details
#field_attributes ⇒ Object
211 212 213 |
# File 'lib/superform/rails.rb', line 211 def field_attributes {} end |
#focus(value = true) ⇒ Object
215 216 217 218 |
# File 'lib/superform/rails.rb', line 215 def focus(value = true) @attributes[:autofocus] = value self end |