Class: Rapid::Baps::Responses::Handlers::MoveItemInPlaylist

Inherits:
Handler show all
Defined in:
lib/ury_rapid/baps/responses/handlers/playlist.rb

Overview

Handles a BAPS item movement

Instance Method Summary collapse

Methods inherited from Services::Responses::Handler

#initialize, #kill_if_exists

Methods inherited from Services::Handler

def_targets, #initialize, register_into, #targets, targets?, use_poster

Constructor Details

This class inherits a constructor from Rapid::Services::Responses::Handler

Instance Method Details

#moveObject

Moves the item pointed to by response to its new index


67
68
69
70
71
# File 'lib/ury_rapid/baps/responses/handlers/playlist.rb', line 67

def move
  # Noting that insert, if applied to an existing resource, moves it
  # to its new URL.
  item_insert(item_find)
end

#runObject


62
63
64
# File 'lib/ury_rapid/baps/responses/handlers/playlist.rb', line 62

def run
  move if @response.new_index != @response.old_index
end