lib/couchrest/mixins/callbacks.rb
def _compile_options(options)        
        return [] if options[:if].empty? && options[:unless].empty?

        conditions = []

        unless options[:if].empty?
          conditions << Array.wrap(_compile_filter(options[:if]))
        end

        unless options[:unless].empty?
          conditions << Array.wrap(_compile_filter(options[:unless])).map {|f| "!#{f}"}
        end

        ["if #{conditions.flatten.join(" && ")}", "end"]
      end
# Options support the same options as filters themselves (and support
# symbols, string, procs, and objects), so compile a conditional
# expression based on the options
Options support the same options as filters themselves (and support
symbols, string, procs, and objects), so compile a conditional
expression based on the options
Options support the same options as filters themselves ( and support symbols string procs and objects ) so compile a conditional expression based on the options
def _compile_options(options)        
        return [] if options[:if].empty? && options[:unless].empty?
        conditions = []
        unless options[:if].empty?
          conditions << Array.wrap(_compile_filter(options[:if]))
        end
        unless options[:unless].empty?
          conditions << Array.wrap(_compile_filter(options[:unless])).map {|f| "!#{f}"}
        end
        ["if #{conditions.flatten.join(" && ")}", "end"]
      end
def _compile_options ( options ) return [ ] if options [ :if ] . empty? && options [ :unless ] . empty? conditions = [ ] unless options [ :if ] . empty? conditions << Array . wrap ( _compile_filter ( options [ :if ] ) ) end unless options [ :unless ] . empty? conditions << Array . wrap ( _compile_filter ( options [ :unless ] ) ) . map { | f | "!#{f}" } end [ "if #{conditions.flatten.join(" && ")}" , "end" ] end
Options support the same options as filters themselves (and support
symbols, string, procs, and objects), so compile a conditional
expression based on the options
Options support the same options as filters themselves ( and support symbols string procs and objects ) so compile a conditional expression based on the options
options