Class: UI::ListSelector

Inherits:
Object
  • Object
show all
Defined in:
lib/ektoplayer/ui/widgets/listwidget.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#start_posObject (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

Returns:

  • (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