Class: OpenRosa::Fields::Range
- Defined in:
- lib/open_rosa/fields/range.rb
Overview
Range field for numeric sliders/pickers
Maps to XForms
Constant Summary collapse
- VALID_TYPES =
i[int decimal].freeze
Instance Attribute Summary collapse
-
#end ⇒ Object
readonly
Returns the value of attribute end.
-
#start ⇒ Object
readonly
Returns the value of attribute start.
-
#step ⇒ Object
readonly
Returns the value of attribute step.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from Base
#default, #hint, #label, #name, #required
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ Range
constructor
A new instance of Range.
Constructor Details
#initialize(name, options = {}) ⇒ Range
Returns a new instance of Range.
13 14 15 16 17 18 19 20 21 |
# File 'lib/open_rosa/fields/range.rb', line 13 def initialize(name, = {}) super @start = [:start] @end = [:end] @step = .fetch(:step, 1) @type = .fetch(:type, :int) validate! end |
Instance Attribute Details
#end ⇒ Object (readonly)
Returns the value of attribute end.
9 10 11 |
# File 'lib/open_rosa/fields/range.rb', line 9 def end @end end |
#start ⇒ Object (readonly)
Returns the value of attribute start.
9 10 11 |
# File 'lib/open_rosa/fields/range.rb', line 9 def start @start end |
#step ⇒ Object (readonly)
Returns the value of attribute step.
9 10 11 |
# File 'lib/open_rosa/fields/range.rb', line 9 def step @step end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/open_rosa/fields/range.rb', line 9 def type @type end |