Class: Bosh::Bootstrap::Commander::Command
- Inherits:
-
Object
- Object
- Bosh::Bootstrap::Commander::Command
- Defined in:
- lib/bosh-bootstrap/commander/command.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
verb e.g.
-
#description ⇒ Object
readonly
noun phrase, e.g.
-
#full_past_tense ⇒ Object
readonly
e.g.
-
#full_present_tense ⇒ Object
readonly
e.g.
Instance Method Summary collapse
-
#initialize(command, description, full_present_tense = nil, full_past_tense = nil) ⇒ Command
constructor
A new instance of Command.
-
#perform(server) ⇒ Object
Invoke this command (subclass) to call back upon
server
to perform a server helper.
Constructor Details
#initialize(command, description, full_present_tense = nil, full_past_tense = nil) ⇒ Command
Returns a new instance of Command.
12 13 14 15 16 17 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 12 def initialize(command, description, full_present_tense=nil, full_past_tense=nil) @command = command @description = description @full_present_tense = full_present_tense || "#{command} #{description}" @full_past_tense = full_past_tense || "#{command} #{description}" end |
Instance Attribute Details
#command ⇒ Object (readonly)
verb e.g. “install”
6 7 8 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 6 def command @command end |
#description ⇒ Object (readonly)
noun phrase, e.g. “packages”
7 8 9 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 7 def description @description end |
#full_past_tense ⇒ Object (readonly)
e.g. “installed packages”
10 11 12 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 10 def full_past_tense @full_past_tense end |
#full_present_tense ⇒ Object (readonly)
e.g. “installing packages”
9 10 11 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 9 def full_present_tense @full_present_tense end |
Instance Method Details
#perform(server) ⇒ Object
Invoke this command (subclass) to call back upon server
to perform a server helper
21 22 23 |
# File 'lib/bosh-bootstrap/commander/command.rb', line 21 def perform(server) raise "please implement this method to call back upon `server`" end |