Class: Dragonfly::Job::Step
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
Class Method Summary collapse
-
.abbreviation ⇒ Object
Dragonfly::Job::Fetch -> :f.
-
.basename ⇒ Object
Dragonfly::Job::Fetch -> ‘Fetch’.
-
.step_name ⇒ Object
Dragonfly::Job::Fetch -> :fetch.
Instance Method Summary collapse
-
#initialize(*args) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #update_temp_object(job, content, extra) ⇒ Object
Constructor Details
#initialize(*args) ⇒ Step
Returns a new instance of Step.
38 39 40 |
# File 'lib/dragonfly/job.rb', line 38 def initialize(*args) @args = args end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args
42 43 44 |
# File 'lib/dragonfly/job.rb', line 42 def args @args end |
Class Method Details
.abbreviation ⇒ Object
Dragonfly::Job::Fetch -> :f
33 34 35 |
# File 'lib/dragonfly/job.rb', line 33 def abbreviation @abbreviation ||= basename.scan(/[A-Z]/).join.downcase.to_sym end |
.basename ⇒ Object
Dragonfly::Job::Fetch -> ‘Fetch’
25 26 27 |
# File 'lib/dragonfly/job.rb', line 25 def basename @basename ||= name.split('::').last end |
.step_name ⇒ Object
Dragonfly::Job::Fetch -> :fetch
29 30 31 |
# File 'lib/dragonfly/job.rb', line 29 def step_name @step_name ||= basename.gsub(/[A-Z]/){ "_#{$&.downcase}" }.sub('_','').to_sym end |
Instance Method Details
#inspect ⇒ Object
50 51 52 |
# File 'lib/dragonfly/job.rb', line 50 def inspect "#{self.class.step_name}(#{args.map{|a| a.inspect }.join(', ')})" end |
#update_temp_object(job, content, extra) ⇒ Object
44 45 46 47 48 |
# File 'lib/dragonfly/job.rb', line 44 def update_temp_object(job, content, extra) temp_object = TempObject.new(content, job.temp_object.attributes) temp_object.extract_attributes_from(extra) if extra job.temp_object = temp_object end |