class CouchRest::Mixins::Callbacks::CallbackChain

An Array with a compile method

Public Instance Methods

clone(klass) click to toggle source
# File lib/couchrest/mixins/callbacks.rb, line 366
def clone(klass)
  chain = CallbackChain.new(@symbol)
  chain.push(*map {|c| c.clone(klass)})
end
compile(key = nil, options = {}) click to toggle source
# File lib/couchrest/mixins/callbacks.rb, line 353
def compile(key = nil, options = {})
  method = []
  method << "halted = false"
  each do |callback|
    method << callback.start(key, options)
  end
  method << "yield self if block_given? && !halted"
  reverse_each do |callback|
    method << callback.end(key, options)
  end
  method.compact.join("\n")
end

Public Class Methods

new(symbol) click to toggle source
# File lib/couchrest/mixins/callbacks.rb, line 349
def initialize(symbol)
  @symbol = symbol
end