Class: LcpRuby::Dsl::DslLoader::JobEvalContext
- Inherits:
-
Object
- Object
- LcpRuby::Dsl::DslLoader::JobEvalContext
- Defined in:
- lib/lcp_ruby/dsl/dsl_loader.rb
Overview
Isolated evaluation context for job DSL files.
Instance Attribute Summary collapse
-
#job_definitions ⇒ Object
readonly
Returns the value of attribute job_definitions.
Instance Method Summary collapse
- #define_job(name, &block) ⇒ Object
-
#initialize ⇒ JobEvalContext
constructor
A new instance of JobEvalContext.
Constructor Details
#initialize ⇒ JobEvalContext
Returns a new instance of JobEvalContext.
337 338 339 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 337 def initialize @job_definitions = [] end |
Instance Attribute Details
#job_definitions ⇒ Object (readonly)
Returns the value of attribute job_definitions.
335 336 337 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 335 def job_definitions @job_definitions end |
Instance Method Details
#define_job(name, &block) ⇒ Object
341 342 343 344 345 346 |
# File 'lib/lcp_ruby/dsl/dsl_loader.rb', line 341 def define_job(name, &block) builder = JobBuilder.new(name) builder.instance_eval(&block) hash = builder.to_hash @job_definitions << BackgroundJobs::Definition.from_hash(hash) end |