Class: Voom::Presenters::DSL::Components::Input

Inherits:
EventBase show all
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

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #css_class, #draggable, #drop_zone, #id, #tag, #type

Instance Method Summary collapse

Methods included from Mixins::Tooltips

#tooltip

Methods included from Mixins::Event

#event

Methods inherited from Base

#expand!

Methods included from Pluggable

#include_plugins, #plugin, #plugin_module

Methods included from Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#locked?

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

#dirtyableObject (readonly)

Returns the value of attribute dirtyable.



8
9
10
# File 'lib/voom/presenters/dsl/components/input.rb', line 8

def dirtyable
  @dirtyable
end

#disabledObject (readonly)

Returns the value of attribute disabled.



8
9
10
# File 'lib/voom/presenters/dsl/components/input.rb', line 8

def disabled
  @disabled
end

#nameObject (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