Class: Dragonfly::Job::Encode

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

Instance Attribute Summary

Attributes inherited from Step

#args, #job

Instance Method Summary (collapse)

Methods inherited from Step

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

Constructor Details

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

Instance Method Details

- (Object) apply

Raises:



98
99
100
101
102
# File 'lib/dragonfly/job.rb', line 98

def apply
  raise NothingToEncode, "Can't encode because temp object has not been initialized. Need to fetch first?" unless job.temp_object
  content, meta = job.app.encoder.encode(job.temp_object, format, *arguments)
  job.update(content, (meta || {}).merge(:format => format))
end

- (Object) arguments



95
96
97
# File 'lib/dragonfly/job.rb', line 95

def arguments
  args[1..-1]
end

- (Object) format



92
93
94
# File 'lib/dragonfly/job.rb', line 92

def format
  args.first.to_sym
end

- (Object) init



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

def init
  job.url_attrs[:format] = format
end