Class: ForemanPatch::Api::V2::WindowsController
- Inherits:
-
BaseController
- Object
- Api::V2::BaseController
- BaseController
- ForemanPatch::Api::V2::WindowsController
- Defined in:
- app/controllers/foreman_patch/api/v2/windows_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #index ⇒ Object
- #resource_class ⇒ Object
- #schedule ⇒ Object
- #show ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
40 41 42 43 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 40 def create @window = Window.new(window_params) process_response @window.save end |
#destroy ⇒ Object
54 55 56 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 54 def destroy process_response @window.destroy end |
#index ⇒ Object
18 19 20 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 18 def index @windows = resource_scope_for_index(params.permit(:cycle_id)) end |
#resource_class ⇒ Object
64 65 66 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 64 def resource_class ForemanPatch::Window end |
#schedule ⇒ Object
60 61 62 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 60 def schedule ::ForemanTasks.delay(::Actions::ForemanPatch::Window::Patch, , @window) end |
#show ⇒ Object
24 25 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 24 def show end |
#update ⇒ Object
48 49 50 |
# File 'app/controllers/foreman_patch/api/v2/windows_controller.rb', line 48 def update process_response @window.update(window_params) end |