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