Class: Space::Shell::Command
- Inherits:
-
Object
- Object
- Space::Shell::Command
- Defined in:
- lib/space/shell/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context, command) ⇒ Command
constructor
A new instance of Command.
- #run ⇒ Object
Constructor Details
#initialize(context, command) ⇒ Command
Returns a new instance of Command.
14 15 16 17 |
# File 'lib/space/shell/command.rb', line 14 def initialize(context, command) @context = context @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
12 13 14 |
# File 'lib/space/shell/command.rb', line 12 def command @command end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
12 13 14 |
# File 'lib/space/shell/command.rb', line 12 def context @context end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
12 13 14 |
# File 'lib/space/shell/command.rb', line 12 def result @result end |
Class Method Details
.execute(command) ⇒ Object
7 8 9 |
# File 'lib/space/shell/command.rb', line 7 def execute(command) `#{command}` end |