Class: Voom::Presenters::DSL::Components::Slider
- Defined in:
- lib/voom/presenters/dsl/components/slider.rb
Instance Attribute Summary collapse
-
#discrete ⇒ Object
readonly
Returns the value of attribute discrete.
-
#show_tracker_marks ⇒ Object
readonly
Returns the value of attribute show_tracker_marks.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
-
#value_max ⇒ Object
readonly
Returns the value of attribute value_max.
-
#value_min ⇒ Object
readonly
Returns the value of attribute value_min.
Attributes inherited from Input
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) ⇒ Slider
constructor
A new instance of Slider.
- #label(text = nil) ⇒ Object
- #value(value = nil) ⇒ Object
Methods inherited from Input
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) ⇒ Slider
Returns a new instance of Slider.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 12 def initialize(**attribs_, &block) super(type: :slider, **attribs_, &block) @value_min = attribs.delete(:value_min){0} @value_max = attribs.delete(:value_max){100} @step = attribs.delete(:step){nil} @discrete = attribs.delete(:discrete){true} @show_tracker_marks = attribs.delete(:show_tracker_marks){false} @show_tracker_marks = false unless discrete end |
Instance Attribute Details
#discrete ⇒ Object (readonly)
Returns the value of attribute discrete.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 6 def discrete @discrete end |
#show_tracker_marks ⇒ Object (readonly)
Returns the value of attribute show_tracker_marks.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 6 def show_tracker_marks @show_tracker_marks end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 6 def step @step end |
#value_max ⇒ Object (readonly)
Returns the value of attribute value_max.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 6 def value_max @value_max end |
#value_min ⇒ Object (readonly)
Returns the value of attribute value_min.
6 7 8 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 6 def value_min @value_min end |
Instance Method Details
#label(text = nil) ⇒ Object
23 24 25 26 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 23 def label(text=nil) return @label if locked? @label = text end |
#value(value = nil) ⇒ Object
28 29 30 31 |
# File 'lib/voom/presenters/dsl/components/slider.rb', line 28 def value(value=nil) return @value if locked? @value = value end |