Class: Cloud::Sh::Commands::Base

Inherits:
Object
  • Object
show all
Includes:
Helpers::Commands
Defined in:
lib/cloud/sh/commands/base.rb

Direct Known Subclasses

K8sExec, K8sTail, Refresh

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Helpers::Commands

#command_chain

Constructor Details

#initialize(options:, args:) ⇒ Base

Returns a new instance of Base.



18
19
20
21
# File 'lib/cloud/sh/commands/base.rb', line 18

def initialize(options:, args:)
  @options = options
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



9
10
11
# File 'lib/cloud/sh/commands/base.rb', line 9

def args
  @args
end

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/cloud/sh/commands/base.rb', line 9

def options
  @options
end

Class Method Details

.execute(global_options, options, args) ⇒ Object



11
12
13
14
15
16
# File 'lib/cloud/sh/commands/base.rb', line 11

def self.execute(global_options, options, args)
  new(options: global_options.merge(options), args: args).execute
rescue Exception => e
  puts e.backtrace.join("\n")
  puts e.inspect
end

Instance Method Details

#configObject



27
28
29
# File 'lib/cloud/sh/commands/base.rb', line 27

def config
  Cloud::Sh.config
end

#executeObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/cloud/sh/commands/base.rb', line 23

def execute
  raise NotImplementedError
end