Class: Rapid::Baps::Responses::Handlers::LoaderHandler

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

Overview

Base class for handlers that wrap a Loader.

Descendants should define methods id and urls, which take the response and return the relevant Loader arguments.

Direct Known Subclasses

ItemData, Load

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

#originNilClass

Returns the origin of an item

This defaults to nil. Subclasses may override this to provide an appropriate origin URL for the item.


30
31
32
# File 'lib/ury_rapid/baps/responses/handlers/loader.rb', line 30

def origin
  nil
end

#runObject


14
15
16
17
18
19
20
21
22
# File 'lib/ury_rapid/baps/responses/handlers/loader.rb', line 14

def run
  Loader.load(
    self,
    @response,
    id,
    urls,
    origin
  )
end