Class: Seira::Memcached

Inherits:
Object
  • Object
show all
Defined in:
lib/seira/memcached.rb

Constant Summary collapse

VALID_ACTIONS =
%w[help list status credentials create delete].freeze
SUMMARY =
"Manage your Helm Memcached instances.".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(app:, action:, args:, context:) ⇒ Memcached

Returns a new instance of Memcached.



11
12
13
14
15
16
# File 'lib/seira/memcached.rb', line 11

def initialize(app:, action:, args:, context:)
  @app = app
  @action = action
  @args = args
  @context = context
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



9
10
11
# File 'lib/seira/memcached.rb', line 9

def action
  @action
end

#appObject (readonly)

Returns the value of attribute app.



9
10
11
# File 'lib/seira/memcached.rb', line 9

def app
  @app
end

#argsObject (readonly)

Returns the value of attribute args.



9
10
11
# File 'lib/seira/memcached.rb', line 9

def args
  @args
end

#contextObject (readonly)

Returns the value of attribute context.



9
10
11
# File 'lib/seira/memcached.rb', line 9

def context
  @context
end

Instance Method Details

#runObject

TODO: logs, upgrades?, backups, restores, CLI connection



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/seira/memcached.rb', line 19

def run
  case action
  when 'help'
    run_help
  when 'list'
    run_list
  when 'status'
    run_status
  when 'credentials'
    run_credentials
  when 'create'
    run_create
  when 'delete'
    run_delete
  else
    fail "Unknown command encountered"
  end
end