Class: Seira::Memcached
- Inherits:
-
Object
- Object
- Seira::Memcached
- 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
-
#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.
Instance Method Summary collapse
-
#initialize(app:, action:, args:, context:) ⇒ Memcached
constructor
A new instance of Memcached.
-
#run ⇒ Object
TODO: logs, upgrades?, backups, restores, CLI connection.
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
#action ⇒ Object (readonly)
Returns the value of attribute action.
9 10 11 |
# File 'lib/seira/memcached.rb', line 9 def action @action end |
#app ⇒ Object (readonly)
Returns the value of attribute app.
9 10 11 |
# File 'lib/seira/memcached.rb', line 9 def app @app end |
#args ⇒ Object (readonly)
Returns the value of attribute args.
9 10 11 |
# File 'lib/seira/memcached.rb', line 9 def args @args end |
#context ⇒ Object (readonly)
Returns the value of attribute context.
9 10 11 |
# File 'lib/seira/memcached.rb', line 9 def context @context end |
Instance Method Details
#run ⇒ Object
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 |