Class: OMF::SFA::AM::Rest::AccountHandler
- Inherits:
-
RestHandler
- Object
- Base::LObject
- RestHandler
- OMF::SFA::AM::Rest::AccountHandler
- Defined in:
- lib/omf-sfa/am/am-rest/account_handler.rb
Overview
Handles the collection of accounts on this AM.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ AccountHandler
constructor
A new instance of AccountHandler.
- #show_resource_list(opts) ⇒ Object
Methods inherited from RestHandler
#call, #convert_to_html, #find_handler, #html_template, load_api_template, #on_delete, #on_get, #on_post, render_html, #render_html, service_name, set_service_name
Constructor Details
#initialize(opts = {}) ⇒ AccountHandler
Returns a new instance of AccountHandler.
13 14 15 16 17 18 19 20 |
# File 'lib/omf-sfa/am/am-rest/account_handler.rb', line 13 def initialize(opts = {}) super @resource_class = OMF::SFA::Resource::OAccount opts[:account_handler] = self @coll_handlers = { active_components: (opts[:resource_handler] || ResourceHandler.new(opts)) } end |
Instance Method Details
#show_resource_list(opts) ⇒ Object
22 23 24 25 26 27 |
# File 'lib/omf-sfa/am/am-rest/account_handler.rb', line 22 def show_resource_list(opts) authenticator = Thread.current["authenticator"] prefix = about = opts[:req].path resources = OMF::SFA::Resource::OAccount.all() show_resources(resources, :resources, opts) end |