Class: Lambit::Commands::Common::Base
- Inherits:
-
Object
- Object
- Lambit::Commands::Common::Base
- Defined in:
- lib/lambit/commands/common.rb
Direct Known Subclasses
Build::PackageTemplatesCommand, CreateWorkspaceCommand, Lambdas::Base
Instance Attribute Summary collapse
-
#dry_run ⇒ Object
readonly
Returns the value of attribute dry_run.
-
#exitstatus ⇒ Object
readonly
Returns the value of attribute exitstatus.
-
#run ⇒ Object
readonly
Returns the value of attribute run.
Class Method Summary collapse
Instance Method Summary collapse
- #command ⇒ Object
- #execute ⇒ Object
-
#initialize(opts, args) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(opts, args) ⇒ Base
Returns a new instance of Base.
47 48 49 50 |
# File 'lib/lambit/commands/common.rb', line 47 def initialize(opts, args) @dry_run = opts['dry-run'] @exitstatus = 1 end |
Instance Attribute Details
#dry_run ⇒ Object (readonly)
Returns the value of attribute dry_run.
44 45 46 |
# File 'lib/lambit/commands/common.rb', line 44 def dry_run @dry_run end |
#exitstatus ⇒ Object (readonly)
Returns the value of attribute exitstatus.
45 46 47 |
# File 'lib/lambit/commands/common.rb', line 45 def exitstatus @exitstatus end |
#run ⇒ Object (readonly)
Returns the value of attribute run.
43 44 45 |
# File 'lib/lambit/commands/common.rb', line 43 def run @run end |
Class Method Details
.run(opts, args) ⇒ Object
52 53 54 55 |
# File 'lib/lambit/commands/common.rb', line 52 def self.run(opts, args) output, exitstatus = self.new(opts, args).execute return output, exitstatus end |
Instance Method Details
#command ⇒ Object
57 58 59 |
# File 'lib/lambit/commands/common.rb', line 57 def command return '', self.exitstatus end |
#execute ⇒ Object
61 62 63 |
# File 'lib/lambit/commands/common.rb', line 61 def execute command end |