Class: UI::ListSelector
- Inherits:
-
Object
- Object
- UI::ListSelector
- Defined in:
- lib/ektoplayer/ui/widgets/listwidget.rb
Instance Attribute Summary collapse
-
#start_pos ⇒ Object
readonly
Returns the value of attribute start_pos.
Instance Method Summary collapse
Instance Attribute Details
#start_pos ⇒ Object (readonly)
Returns the value of attribute start_pos.
22 23 24 |
# File 'lib/ektoplayer/ui/widgets/listwidget.rb', line 22 def start_pos @start_pos end |
Instance Method Details
#start(pos) ⇒ Object
24 25 26 |
# File 'lib/ektoplayer/ui/widgets/listwidget.rb', line 24 def start(pos) @start_pos = pos end |
#started? ⇒ Boolean
28 |
# File 'lib/ektoplayer/ui/widgets/listwidget.rb', line 28 def started?; @start_pos end |
#stop(pos) ⇒ Object
30 31 32 33 34 35 |
# File 'lib/ektoplayer/ui/widgets/listwidget.rb', line 30 def stop(pos) return [] unless @start_pos r = [pos, @start_pos].min.upto([pos, @start_pos].max).to_a @start_pos = nil r end |