Class: Producer::Core::Action
- Inherits:
-
Object
- Object
- Producer::Core::Action
- Extended by:
- Forwardable
- Defined in:
- lib/producer/core/action.rb
Direct Known Subclasses
Producer::Core::Actions::Echo, Producer::Core::Actions::FileAppend, Producer::Core::Actions::FileReplaceContent, Producer::Core::Actions::FileWriter, Producer::Core::Actions::Mkdir, Producer::Core::Actions::ShellCommand
Constant Summary collapse
- INSPECT_ARGUMENTS_SUM_LEN =
68
Instance Attribute Summary collapse
-
#arguments ⇒ Object
readonly
Returns the value of attribute arguments.
-
#env ⇒ Object
readonly
Returns the value of attribute env.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(env, *args) ⇒ Action
constructor
A new instance of Action.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(env, *args) ⇒ Action
Returns a new instance of Action.
13 14 15 16 17 18 |
# File 'lib/producer/core/action.rb', line 13 def initialize env, *args @env = env @arguments = args @options = @arguments[-1].kind_of?(Hash) ? @arguments.pop : {} setup if respond_to? :setup end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
11 12 13 |
# File 'lib/producer/core/action.rb', line 11 def arguments @arguments end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
11 12 13 |
# File 'lib/producer/core/action.rb', line 11 def env @env end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
11 12 13 |
# File 'lib/producer/core/action.rb', line 11 def @options end |
Instance Method Details
#name ⇒ Object
20 21 22 |
# File 'lib/producer/core/action.rb', line 20 def name self.class.name.split('::').last.downcase end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/producer/core/action.rb', line 24 def to_s [name, inspect_arguments].join ' ' end |