Class: Dragonfly::Job::Encode

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

Instance Attribute Summary

Attributes inherited from Step

#args

Instance Method Summary collapse

Methods inherited from Step

abbreviation, basename, #initialize, #inspect, step_name, #update_temp_object

Constructor Details

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

Instance Method Details

#apply(job) ⇒ Object

Raises:



86
87
88
89
90
91
# File 'lib/dragonfly/job.rb', line 86

def apply(job)
  raise NothingToEncode, "Can't encode because temp object has not been initialized. Need to fetch first?" unless job.temp_object
  content, extra = job.app.encoder.encode(job.temp_object, format, *arguments)
  update_temp_object(job, content, extra)
  job.temp_object.format = format
end

#argumentsObject



83
84
85
# File 'lib/dragonfly/job.rb', line 83

def arguments
  args[1..-1]
end

#formatObject



80
81
82
# File 'lib/dragonfly/job.rb', line 80

def format
  args.first
end