Class: Rubydoop::ConfigurationDefinition
- Inherits:
-
Object
- Object
- Rubydoop::ConfigurationDefinition
- Defined in:
- lib/rubydoop/dsl.rb
Overview
Lower level API for configuring jobs.
Instance Method Summary collapse
- #arguments ⇒ Object
-
#initialize(context = $rubydoop_context, &block) ⇒ ConfigurationDefinition
constructor
A new instance of ConfigurationDefinition.
- #job(name, &block) ⇒ Object
- #parallel(&block) ⇒ Object
- #sequence(&block) ⇒ Object
Constructor Details
#initialize(context = $rubydoop_context, &block) ⇒ ConfigurationDefinition
Returns a new instance of ConfigurationDefinition.
50 51 52 53 |
# File 'lib/rubydoop/dsl.rb', line 50 def initialize(context=$rubydoop_context, &block) @context = context instance_exec(*arguments, &block) if @context && block_given? end |
Instance Method Details
#arguments ⇒ Object
55 56 57 |
# File 'lib/rubydoop/dsl.rb', line 55 def arguments @context.arguments end |
#job(name, &block) ⇒ Object
59 60 61 62 63 64 |
# File 'lib/rubydoop/dsl.rb', line 59 def job(name, &block) return nil unless @context job = JobDefinition.new(@context, @context.create_job(name)) job.instance_exec(&block) job end |
#parallel(&block) ⇒ Object
66 67 68 |
# File 'lib/rubydoop/dsl.rb', line 66 def parallel(&block) @context.parallel(&block) end |
#sequence(&block) ⇒ Object
70 71 72 |
# File 'lib/rubydoop/dsl.rb', line 70 def sequence(&block) @context.sequence(&block) end |