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