Class: Hyrax::API::ItemsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Hyrax::API::ItemsController
- Defined in:
- app/controllers/hyrax/api/items_controller.rb
Overview
Adds an endpoint that consumes and RESTfully emits JSON from Arkivo representing new and updated Zotero-managed publications. An item in the Zotero parlance is mapped to a work in Hyrax.
Instance Attribute Summary collapse
-
#item ⇒ Object
readonly
Returns the value of attribute item.
Instance Method Summary collapse
Instance Attribute Details
#item ⇒ Object (readonly)
Returns the value of attribute item.
13 14 15 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 13 def item @item end |
Instance Method Details
#create ⇒ Object
15 16 17 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 15 def create head :created, location: hyrax.api_item_path(actor.create_work_from_item) end |
#destroy ⇒ Object
24 25 26 27 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 24 def destroy actor.destroy_work(@work) head :no_content end |
#show ⇒ Object
29 30 31 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 29 def show head :no_content end |
#update ⇒ Object
19 20 21 22 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 19 def update actor.update_work_from_item(@work) head :no_content end |