Class: Dragonfly::Job::Step
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#job ⇒ Object
readonly
Returns the value of attribute job.
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
- #app ⇒ Object
-
#init ⇒ Object
To be overridden.
-
#initialize(job, *args) ⇒ Step
constructor
A new instance of Step.
- #inspect ⇒ Object
- #to_a ⇒ Object
Constructor Details
#initialize(job, *args) ⇒ Step
Returns a new instance of Step.
20 21 22 23 |
# File 'lib/dragonfly/job/step.rb', line 20 def initialize(job, *args) @job, @args = job, args init end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
28 29 30 |
# File 'lib/dragonfly/job/step.rb', line 28 def args @args end |
#job ⇒ Object (readonly)
Returns the value of attribute job.
28 29 30 |
# File 'lib/dragonfly/job/step.rb', line 28 def job @job end |
Class Method Details
.abbreviation ⇒ Object
Dragonfly::Job::Fetch -> ‘f’
15 16 17 |
# File 'lib/dragonfly/job/step.rb', line 15 def abbreviation @abbreviation ||= basename.scan(/[A-Z]/).join.downcase end |
.basename ⇒ Object
Dragonfly::Job::Fetch -> ‘Fetch’
7 8 9 |
# File 'lib/dragonfly/job/step.rb', line 7 def basename @basename ||= name.split('::').last end |
.step_name ⇒ Object
Dragonfly::Job::Fetch -> :fetch
11 12 13 |
# File 'lib/dragonfly/job/step.rb', line 11 def step_name @step_name ||= basename.gsub(/[A-Z]/){ "_#{$&.downcase}" }.sub('_','').to_sym end |
Instance Method Details
#app ⇒ Object
30 31 32 |
# File 'lib/dragonfly/job/step.rb', line 30 def app job.app end |
#init ⇒ Object
To be overridden
25 26 |
# File 'lib/dragonfly/job/step.rb', line 25 def init # To be overridden end |
#inspect ⇒ Object
38 39 40 |
# File 'lib/dragonfly/job/step.rb', line 38 def inspect "#{self.class.step_name}(#{args.map{|a| a.inspect }.join(', ')})" end |
#to_a ⇒ Object
34 35 36 |
# File 'lib/dragonfly/job/step.rb', line 34 def to_a [self.class.abbreviation, *args] end |