Sha256: 5779bf14324fc888d49d5a8a9b41129e1b95a360e3326db72eecec418ce2c93e

Contents?: true

Size: 1.2 KB

Versions: 68

Compression:

Stored size: 1.2 KB

Contents

# This file is part of CPEE.
# 
# CPEE is free software: you can redistribute it and/or modify it under the terms
# of the GNU General Public License as published by the Free Software Foundation,
# either version 3 of the License, or (at your option) any later version.
# 
# CPEE is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.  See the GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along with
# CPEE (file COPYING in the main directory).  If not, see
# <http://www.gnu.org/licenses/>.

module CPEE

  class Callback
    def initialize(info,handler,method,event,key,protocol,*data)
      @info = info
      @event = event
      @key = key
      @data = data
      @handler = handler
      @protocol = protocol
      @method = method.class == Symbol ? method : :callback
    end

    attr_reader :info, :protocol, :method

    def delete_if!(event,key)
      @handler.send @method, :DELETE, *@data if @key == key && @event == event
      nil
    end

    def callback(result)
      @handler.send @method, result, *@data
    end
  end

end

Version data entries

68 entries across 68 versions & 1 rubygems

Version Path
cpee-1.3.175 lib/cpee/callback.rb
cpee-1.3.174 lib/cpee/callback.rb
cpee-1.3.173 lib/cpee/callback.rb
cpee-1.3.172 lib/cpee/callback.rb
cpee-1.3.171 lib/cpee/callback.rb
cpee-1.3.170 lib/cpee/callback.rb
cpee-1.3.169 lib/cpee/callback.rb
cpee-1.3.167 lib/cpee/callback.rb
cpee-1.3.166 lib/cpee/callback.rb
cpee-1.3.164 lib/cpee/callback.rb
cpee-1.3.163 lib/cpee/callback.rb
cpee-1.3.162 lib/cpee/callback.rb
cpee-1.3.161 lib/cpee/callback.rb
cpee-1.3.160 lib/cpee/callback.rb
cpee-1.3.159 lib/cpee/callback.rb
cpee-1.3.158 lib/cpee/callback.rb
cpee-1.3.157 lib/cpee/callback.rb
cpee-1.3.156 lib/cpee/callback.rb
cpee-1.3.155 lib/cpee/callback.rb
cpee-1.3.154 lib/cpee/callback.rb