Class: Rapid::Services::Responses::Handler

Inherits:
Handler
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/ury_rapid/services/responses/handler.rb

Overview

Abstract class for handlers for a given model object

Handlers are installed on model objects so that, when the server attempts to modify the model object, the handler translates it into a playout system command to perform the actual playout system event the model change represents.

Instance Method Summary collapse

Methods inherited from Handler

def_targets, register_into, #targets, targets?, use_poster

Constructor Details

#initialize(parent, response) ⇒ Handler

Initialises a responses handler


19
20
21
22
23
# File 'lib/ury_rapid/services/responses/handler.rb', line 19

def initialize(parent, response)
  super(parent)
  @response = response
  @model = parent.model
end

Instance Method Details

#kill_if_exists(*args) ⇒ null

Like kill, but does not fail if the resource does not exist.


33
34
35
36
37
# File 'lib/ury_rapid/services/responses/handler.rb', line 33

def kill_if_exists(*args)
  kill(*args)
rescue Rapid::Common::Exceptions::MissingResource
  nil
end