Class: Metacrunch::Job::Dsl
- Inherits:
-
Object
- Object
- Metacrunch::Job::Dsl
- Defined in:
- lib/metacrunch/job/dsl.rb
Defined Under Namespace
Classes: Options
Instance Method Summary collapse
- #destination(destination) ⇒ Object
-
#initialize(job) ⇒ Dsl
constructor
A new instance of Dsl.
- #options(require_args: false, &block) ⇒ Object
- #post_process(callable) ⇒ Object
- #pre_process(callable) ⇒ Object
- #source(source) ⇒ Object
- #transformation(callable, buffer_size: nil, buffer: nil) ⇒ Object
Constructor Details
#initialize(job) ⇒ Dsl
Returns a new instance of Dsl.
5 6 7 |
# File 'lib/metacrunch/job/dsl.rb', line 5 def initialize(job) @_job = job end |
Instance Method Details
#destination(destination) ⇒ Object
13 14 15 |
# File 'lib/metacrunch/job/dsl.rb', line 13 def destination(destination) @_job.destination = destination end |
#options(require_args: false, &block) ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/metacrunch/job/dsl.rb', line 29 def (require_args: false, &block) if block_given? = Options.new(require_args: require_args, &block). else ||= {} end end |
#post_process(callable) ⇒ Object
21 22 23 |
# File 'lib/metacrunch/job/dsl.rb', line 21 def post_process(callable) @_job.post_process = callable end |
#pre_process(callable) ⇒ Object
17 18 19 |
# File 'lib/metacrunch/job/dsl.rb', line 17 def pre_process(callable) @_job.pre_process = callable end |
#source(source) ⇒ Object
9 10 11 |
# File 'lib/metacrunch/job/dsl.rb', line 9 def source(source) @_job.source = source end |
#transformation(callable, buffer_size: nil, buffer: nil) ⇒ Object
25 26 27 |
# File 'lib/metacrunch/job/dsl.rb', line 25 def transformation(callable, buffer_size: nil, buffer: nil) @_job.add_transformation(callable, buffer_size: buffer_size, buffer: buffer) end |