Sha256: 800d2dfba9444c94b976c6356579e7d10ec3f9784f5f7f1df9fd8707bb23f327

Contents?: true

Size: 594 Bytes

Versions: 58

Compression:

Stored size: 594 Bytes

Contents

module Dragonfly
  class JobDefinitions < Module

    def initialize
      @job_definitions = {}
    end

    def add(name, &definition_proc)
      job_definitions[name] = JobBuilder.new(&definition_proc)
      jd = job_definitions # Needed because we're about to change 'self'
      
      define_method name do |*args|
        jd[name].build(self, *args)
      end
      
      define_method "#{name}!" do |*args|
        jd[name].build!(self, *args)
      end
    end
    
    def definition_names
      job_definitions.keys
    end

    private

    attr_reader :job_definitions

  end
end

Version data entries

58 entries across 58 versions & 2 rubygems

Version Path
classiccms-0.7.5 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.7.4 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.7.3 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.7.2 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.7.1 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.7.0 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
dragonfly-0.9.15 lib/dragonfly/job_definitions.rb
dragonfly-0.9.14 lib/dragonfly/job_definitions.rb
dragonfly-0.9.13 lib/dragonfly/job_definitions.rb
classiccms-0.6.9 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.8 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.7 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.6 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.5 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.4 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.3 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.2 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.1 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.6.0 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb
classiccms-0.5.17 vendor/bundle/gems/dragonfly-0.9.12/lib/dragonfly/job_definitions.rb