Class: Shred::Commands::Services::Service
- Inherits:
-
Object
- Object
- Shred::Commands::Services::Service
- Defined in:
- lib/shred/commands/services.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#sym ⇒ Object
readonly
Returns the value of attribute sym.
Instance Method Summary collapse
-
#initialize(sym: nil) ⇒ Service
constructor
A new instance of Service.
- #start(ctx, command_lines) ⇒ Object
- #stop(ctx, command_lines) ⇒ Object
Constructor Details
#initialize(sym: nil) ⇒ Service
Returns a new instance of Service.
11 12 13 |
# File 'lib/shred/commands/services.rb', line 11 def initialize(sym: nil) @sym = sym end |
Instance Attribute Details
#sym ⇒ Object (readonly)
Returns the value of attribute sym.
9 10 11 |
# File 'lib/shred/commands/services.rb', line 9 def sym @sym end |
Instance Method Details
#start(ctx, command_lines) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/shred/commands/services.rb', line 15 def start(ctx, command_lines) ctx.run_shell_command(ShellCommand.new( command_lines: command_lines, success_msg: "#{sym} started", error_msg: "#{sym} could not be started" )) end |
#stop(ctx, command_lines) ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/shred/commands/services.rb', line 23 def stop(ctx, command_lines) ctx.run_shell_command(ShellCommand.new( command_lines: command_lines, success_msg: "#{sym} stopped", error_msg: "#{sym} could not be stopped" )) end |