Class: Voom::Presenters::DSL::Components::NumberField

Inherits:
TextField show all
Defined in:
lib/voom/presenters/dsl/components/number_field.rb

Constant Summary

Constants inherited from TextField

TextField::VALID_CASE_TYPES

Instance Attribute Summary collapse

Attributes inherited from TextField

#auto_complete, #behavior, #case_type, #full_width, #required

Attributes inherited from Input

#dirtyable, #disabled, #name

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 inherited from TextField

#hint, #icon, #label, #pattern, #value

Methods inherited from Input

#validation_error

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) ⇒ NumberField

Returns a new instance of NumberField.



8
9
10
11
12
13
14
15
# File 'lib/voom/presenters/dsl/components/number_field.rb', line 8

def initialize(**attribs_, &block)
  super(type: :number_field, **attribs_, &block)
  @min = attribs.delete(:min)
  @max = attribs.delete(:max)
  @step = attribs.delete(:step)
  @readonly = attribs.delete(:readonly){false}
  expand!
end

Instance Attribute Details

#maxObject (readonly)

Returns the value of attribute max.



6
7
8
# File 'lib/voom/presenters/dsl/components/number_field.rb', line 6

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



6
7
8
# File 'lib/voom/presenters/dsl/components/number_field.rb', line 6

def min
  @min
end

#readonlyObject (readonly)

Returns the value of attribute readonly.



6
7
8
# File 'lib/voom/presenters/dsl/components/number_field.rb', line 6

def readonly
  @readonly
end

#stepObject (readonly)

Returns the value of attribute step.



6
7
8
# File 'lib/voom/presenters/dsl/components/number_field.rb', line 6

def step
  @step
end