Sha256: dac9c15bb8fa0e6d3524519d8fd5037886e9742a37d459ec60b57d24f1ee6533

Contents?: true

Size: 1001 Bytes

Versions: 1

Compression:

Stored size: 1001 Bytes

Contents

unless defined? $__rq_job__
  module RQ 
#{{{
    LIBDIR = File::dirname(File::expand_path(__FILE__)) + File::SEPARATOR unless
      defined? LIBDIR

    require LIBDIR + 'util'
    require LIBDIR + 'qdb'

    class  Job
#{{{
      module Methods
#{{{
        def method_missing(meth, *args, &block)
#{{{
          setpat = %r/=$/o
          meth = "#{ meth }"
          setter = meth =~ setpat 
          meth.gsub! setpat, ''
          if fields.include? "#{ meth }"
            if setter
              self.send('[]=', meth, *args, &block)
            else
              self.send('[]', meth, *args, &block)
            end
          else
            super
          end
#}}}
        end
#}}}
      end
      class << self
#{{{
        def new(*a, &b)
#{{{
          t = QDB::tuple
          kvs = Util::hashify(*a)
          kvs.each{|k,v| t[k] = v}
          t.extend Methods
          t
#}}}
        end
#}}}
      end
#}}}
    end # class Job
#}}}
  end # module RQ
$__rq_job__ = __FILE__ 
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rq-0.1.7 lib/rq-0.1.7/job.rb