Class: Seira::Commands::Teleport
- Inherits:
-
Object
- Object
- Seira::Commands::Teleport
- Defined in:
- lib/seira/commands/teleport.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
Instance Method Summary collapse
-
#initialize(command, context: nil) ⇒ Teleport
constructor
A new instance of Teleport.
- #invoke(clean_output: false, return_output: false) ⇒ Object
Constructor Details
#initialize(command, context: nil) ⇒ Teleport
Returns a new instance of Teleport.
6 7 8 9 |
# File 'lib/seira/commands/teleport.rb', line 6 def initialize(command, context: nil) @command = command @context = context end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
4 5 6 |
# File 'lib/seira/commands/teleport.rb', line 4 def command @command end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
4 5 6 |
# File 'lib/seira/commands/teleport.rb', line 4 def context @context end |
Instance Method Details
#invoke(clean_output: false, return_output: false) ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/seira/commands/teleport.rb', line 11 def invoke(clean_output: false, return_output: false) puts "Calling: #{calculated_command.green}" unless clean_output if return_output `#{calculated_command}` else system(calculated_command) end end |