Class: Seira::Pods
Constant Summary collapse
- VALID_ACTIONS =
%w[help list delete logs top run connect].freeze
- SUMMARY =
"Manage your application's pods.".freeze
Instance Attribute Summary collapse
-
#action ⇒ Object
readonly
Returns the value of attribute action.
-
#app ⇒ Object
readonly
Returns the value of attribute app.
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#context ⇒ Object
readonly
Returns the value of attribute context.
-
#pod_name ⇒ Object
readonly
Returns the value of attribute pod_name.
Instance Method Summary collapse
-
#initialize(app:, action:, args:, context:) ⇒ Pods
constructor
A new instance of Pods.
- #run ⇒ Object
Methods included from Commands
#gcloud, gcloud, kubectl, #kubectl, #tsh, tsh
Constructor Details
#initialize(app:, action:, args:, context:) ⇒ Pods
Returns a new instance of Pods.
12 13 14 15 16 17 18 |
# File 'lib/seira/pods.rb', line 12 def initialize(app:, action:, args:, context:) @app = app @action = action @context = context @args = args @pod_name = args[0] end |
Instance Attribute Details
#action ⇒ Object (readonly)
Returns the value of attribute action.
10 11 12 |
# File 'lib/seira/pods.rb', line 10 def action @action end |
#app ⇒ Object (readonly)
Returns the value of attribute app.
10 11 12 |
# File 'lib/seira/pods.rb', line 10 def app @app end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
10 11 12 |
# File 'lib/seira/pods.rb', line 10 def args @args end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
10 11 12 |
# File 'lib/seira/pods.rb', line 10 def context @context end |
#pod_name ⇒ Object (readonly)
Returns the value of attribute pod_name.
10 11 12 |
# File 'lib/seira/pods.rb', line 10 def pod_name @pod_name end |
Instance Method Details
#run ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/seira/pods.rb', line 20 def run case action when 'help' run_help when 'list' run_list when 'delete' run_delete when 'logs' run_logs when 'top' run_top when 'connect' run_connect else fail "Unknown command encountered" end end |