Class: Rapid::Services::Requests::VariableHandler

Inherits:
Handler show all
Defined in:
lib/ury_rapid/services/requests/handler.rb

Overview

Extension of Handler implementing default behaviour for Variables.

By default, the semantics of DELETE on a Variable is that it PUTs the Variable's default initial state.

Constant Summary

Constants inherited from Handler

Handler::HOOKS

Instance Method Summary collapse

Methods inherited from Handler

add_hook, add_id_hook, delete_by_deleting_children, #initialize, on_delete, post_by_putting_to_child_for, put_by_payload_processor, put_by_posting_to_parent, #run, service_should_override, #to_s, use_payload_processor_for

Methods inherited from Handler

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

Constructor Details

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

Instance Method Details

#delete(variable, payload) ⇒ Object

Requests a DELETE of the given Variable via the BAPS server

This effectively sets the Variable to its default value.

Examples:

DELETE a Variable

variable_handler.delete(variable)

139
140
141
142
# File 'lib/ury_rapid/services/requests/handler.rb', line 139

def delete(variable, payload)
  put(variable,
      payload.with_body(variable.id => variable.initial_value))
end