Module: CPEE::Callbacks

Defined in:
lib/cpee/implementation_callbacks.rb

Defined Under Namespace

Classes: Callbacks, DelCallback, ExCallback, GetCallback

Class Method Summary collapse

Class Method Details

.implementation(id, opts) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cpee/implementation_callbacks.rb', line 21

def self::implementation(id,opts)
  Proc.new do
    if CPEE::Persistence::exists?(id,opts)
      run CPEE::Callbacks::Callbacks, id, opts if get
      on resource do
        run CPEE::Callbacks::GetCallback, id, opts if get
        run CPEE::Callbacks::DelCallback, id, opts if delete
        run CPEE::Callbacks::ExCallback, id, opts if put
      end
    else
      run CPEE::FAIL
    end
  end
end