Class: Voom::Presenters::DSL::Components::HiddenField

Inherits:
Input show all
Defined in:
lib/voom/presenters/dsl/components/hidden_field.rb

Instance Attribute Summary collapse

Attributes inherited from EventBase

#event_parent_id

Attributes included from Mixins::Event

#events

Attributes inherited from Base

#attributes, #context, #id, #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 Mixins::YieldTo

#yield_to

Methods included from Serializer

#to_hash

Methods included from Lockable

#lock!, #locked?

Constructor Details

#initialize(**attribs_, &block) ⇒ HiddenField

Returns a new instance of HiddenField.



10
11
12
13
14
# File 'lib/voom/presenters/dsl/components/hidden_field.rb', line 10

def initialize(**attribs_, &block)
  super(type: :hidden_field, context: context,
        **attribs_, &block)
  expand!
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

Instance Method Details

#value(value = nil) ⇒ Object



16
17
18
19
# File 'lib/voom/presenters/dsl/components/hidden_field.rb', line 16

def value(value=nil)
  return @value if locked?
  @value = value
end