Class: KStor::Controller::Secret
- Inherits:
-
Object
- Object
- KStor::Controller::Secret
- Defined in:
- lib/kstor/controller/secret.rb
Overview
Handle secret-related requests.
Instance Method Summary collapse
- #handle_request(user, req) ⇒ Object
-
#initialize(store) ⇒ Secret
constructor
A new instance of Secret.
Constructor Details
#initialize(store) ⇒ Secret
Returns a new instance of Secret.
16 17 18 |
# File 'lib/kstor/controller/secret.rb', line 16 def initialize(store) @store = store end |
Instance Method Details
#handle_request(user, req) ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/kstor/controller/secret.rb', line 20 def handle_request(user, req) case req.type when 'secret-create' then handle_create(user, req) when 'secret-search' then handle_search(user, req) when 'secret-unlock' then handle_unlock(user, req) when 'secret-update-meta' then (user, req) when 'secret-update-value' then handle_update_value(user, req) when 'secret-delete' then handle_delete(user, req) else raise Error.for_code('REQ/UNKNOWN', req.type) end end |