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.
12 13 14 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 12 def item @item end |
Instance Method Details
#create ⇒ Object
14 15 16 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 14 def create head :created, location: hyrax.api_item_path(actor.create_work_from_item) end |
#destroy ⇒ Object
23 24 25 26 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 23 def destroy actor.destroy_work(@work) head :no_content end |
#show ⇒ Object
28 29 30 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 28 def show head :no_content end |
#update ⇒ Object
18 19 20 21 |
# File 'app/controllers/hyrax/api/items_controller.rb', line 18 def update actor.update_work_from_item(@work) head :no_content end |