Class: Dragonfly::Job::Generate

Inherits:
Step show all
Defined in:
lib/dragonfly/job/generate.rb

Instance Attribute Summary

Attributes inherited from Step

#args, #job

Instance Method Summary collapse

Methods inherited from Step

abbreviation, #app, basename, #initialize, #inspect, step_name, #to_a

Constructor Details

This class inherits a constructor from Dragonfly::Job::Step

Instance Method Details

#applyObject


22
23
24
# File 'lib/dragonfly/job/generate.rb', line 22

def apply
  generator.call(job.content, *arguments)
end

#argumentsObject


18
19
20
# File 'lib/dragonfly/job/generate.rb', line 18

def arguments
  args[1..-1]
end

#generatorObject


14
15
16
# File 'lib/dragonfly/job/generate.rb', line 14

def generator
  @generator ||= app.get_generator(name)
end

#initObject


6
7
8
# File 'lib/dragonfly/job/generate.rb', line 6

def init
  generator.update_url(job.url_attributes, *arguments) if generator.respond_to?(:update_url)
end

#nameObject


10
11
12
# File 'lib/dragonfly/job/generate.rb', line 10

def name
  args.first
end