Class: UnderOs::UI::Slider
- Inherits:
-
Input
- Object
- Input
- UnderOs::UI::Slider
- Defined in:
- lib/under_os/ui/slider.rb
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Slider
constructor
A new instance of Slider.
- #max ⇒ Object
- #max=(value) ⇒ Object
- #min ⇒ Object
- #min=(value) ⇒ Object
- #value ⇒ Object
- #value=(value) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Slider
Returns a new instance of Slider.
4 5 6 7 8 9 10 11 12 |
# File 'lib/under_os/ui/slider.rb', line 4 def initialize(={}) super self.min = [:min] if [:min] self.max = [:max] if [:max] @_.continuous = .delete(:track) || true # track the changes as they go @_.addTarget self, action: :handle_change, forControlEvents:UIControlEventValueChanged end |
Instance Method Details
#max ⇒ Object
30 31 32 |
# File 'lib/under_os/ui/slider.rb', line 30 def max @_.maximumValue end |
#max=(value) ⇒ Object
34 35 36 |
# File 'lib/under_os/ui/slider.rb', line 34 def max=(value) @_.maximumValue = value.to_f end |
#min ⇒ Object
22 23 24 |
# File 'lib/under_os/ui/slider.rb', line 22 def min @_.minimumValue end |
#min=(value) ⇒ Object
26 27 28 |
# File 'lib/under_os/ui/slider.rb', line 26 def min=(value) @_.minimumValue = value.to_f end |
#value ⇒ Object
14 15 16 |
# File 'lib/under_os/ui/slider.rb', line 14 def value @_.value end |
#value=(value) ⇒ Object
18 19 20 |
# File 'lib/under_os/ui/slider.rb', line 18 def value=(value) @_.value = value.to_f end |