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.freeze
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, **options) ⇒ Action
constructor
A new instance of Action.
- #name ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(env, *args, **options) ⇒ Action
Returns a new instance of Action.
12 13 14 15 16 17 |
# File 'lib/producer/core/action.rb', line 12 def initialize(env, *args, **) @env = env @arguments = args @options = setup if respond_to? :setup end |
Instance Attribute Details
#arguments ⇒ Object (readonly)
Returns the value of attribute arguments.
10 11 12 |
# File 'lib/producer/core/action.rb', line 10 def arguments @arguments end |
#env ⇒ Object (readonly)
Returns the value of attribute env.
10 11 12 |
# File 'lib/producer/core/action.rb', line 10 def env @env end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/producer/core/action.rb', line 10 def @options end |
Instance Method Details
#name ⇒ Object
19 20 21 |
# File 'lib/producer/core/action.rb', line 19 def name self.class.name.split('::').last.downcase end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/producer/core/action.rb', line 23 def to_s [name, inspect_arguments].join ' ' end |