Class: Voom::Presenters::DSL::Components::Input
- Includes:
- Mixins::Tooltips
- Defined in:
- lib/voom/presenters/dsl/components/input.rb
Direct Known Subclasses
FileInput, HiddenField, Select, Slider, TextField, ToggleBase
Instance Attribute Summary collapse
-
#dirtyable ⇒ Object
readonly
Returns the value of attribute dirtyable.
-
#disabled ⇒ Object
readonly
Returns the value of attribute disabled.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from EventBase
Attributes included from Mixins::Event
Attributes inherited from Base
#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type
Instance Method Summary collapse
-
#initialize(**attribs_, &block) ⇒ Input
constructor
A new instance of Input.
-
#validation_error(error = nil) ⇒ Object
If present this error message will be displayed in place of the validation message produced by the underlying component.
Methods included from Mixins::Tooltips
Methods included from Mixins::Event
Methods inherited from Base
Methods included from Pluggable
#include_plugins, #plugin, #plugin_module
Methods included from Mixins::YieldTo
Methods included from Serializer
Methods included from Lockable
Constructor Details
#initialize(**attribs_, &block) ⇒ Input
Returns a new instance of Input.
12 13 14 15 16 17 |
# File 'lib/voom/presenters/dsl/components/input.rb', line 12 def initialize(**attribs_, &block) super(**attribs_, &block) @name = attribs.delete(:name) @dirtyable = attribs.delete(:dirtyable) { true } @disabled = attribs.delete(:disabled) { false } end |
Instance Attribute Details
#dirtyable ⇒ Object (readonly)
Returns the value of attribute dirtyable.
8 9 10 |
# File 'lib/voom/presenters/dsl/components/input.rb', line 8 def dirtyable @dirtyable end |
#disabled ⇒ Object (readonly)
Returns the value of attribute disabled.
8 9 10 |
# File 'lib/voom/presenters/dsl/components/input.rb', line 8 def disabled @disabled end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/voom/presenters/dsl/components/input.rb', line 8 def name @name end |
Instance Method Details
#validation_error(error = nil) ⇒ Object
If present this error message will be displayed in place of the validation message produced by the underlying component.
21 22 23 24 |
# File 'lib/voom/presenters/dsl/components/input.rb', line 21 def validation_error(error=nil) return @validation_error if locked? @validation_error = error end |