Class: Vnehm::TracksViewCommand
- Defined in:
- lib/vnehm/tracks_view_command.rb
Direct Known Subclasses
Constant Summary collapse
- DEFAULT_LIMIT =
10
- DEFAULT_OFFSET =
0
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize ⇒ TracksViewCommand
constructor
A new instance of TracksViewCommand.
Methods inherited from Command
#add_option, #arguments, #handle_options, #invoke, #program_name, #summary, #usage
Constructor Details
#initialize ⇒ TracksViewCommand
Returns a new instance of TracksViewCommand.
8 9 10 |
# File 'lib/vnehm/tracks_view_command.rb', line 8 def initialize super end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/vnehm/tracks_view_command.rb', line 12 def execute setup_environment old_offset = @offset @queue = [] @track_manager = TrackManager.new(@options) tracks = get_tracks UI.term 'У Вас ещё нет аудиозаписей' if tracks.nil? loop do # If offset changed, update list of tracks unless old_offset == @offset tracks = get_tracks old_offset = @offset end if tracks.nil? prev_page next end (tracks) end end |