Class: LinkedRails::Manifest
- Inherits:
-
Object
- Object
- LinkedRails::Manifest
- Includes:
- ActiveModel::Model, Model
- Defined in:
- app/models/linked_rails/manifest.rb
Constant Summary
Constants included from LinkedRails::Model::Collections
LinkedRails::Model::Collections::COLLECTION_CUSTOMIZABLE_OPTIONS, LinkedRails::Model::Collections::COLLECTION_OPTIONS, LinkedRails::Model::Collections::COLLECTION_STATIC_OPTIONS
Class Method Summary collapse
Instance Method Summary collapse
Methods included from Model
Methods included from LinkedRails::Model::Singularable
#root_relative_iri, #root_relative_singular_iri, #singular_iri, #singular_iri?, #singular_iri_opts, #singular_iri_template, #singular_resource?
Methods included from LinkedRails::Model::Serialization
#preview_includes, #show_includes
Methods included from LinkedRails::Model::Menuable
Methods included from LinkedRails::Model::IRI
#anonymous_iri, #anonymous_iri?, #iri, #iri_elements, #iri_opts, #rdf_type, #reload, #root_relative_iri, #route_fragment
Methods included from LinkedRails::Model::Enhancements
Methods included from LinkedRails::Model::Dirty
Methods included from LinkedRails::Model::Collections
#collection_for, #collection_iri, #collection_options_for, #collection_root_relative_iri, #parent_collections
Methods included from LinkedRails::Model::Actionable
#action, #action_list, #action_triples, #actions, #collection_actions, #favorite_actions
Class Method Details
.destroy(iri) ⇒ Object
163 164 165 |
# File 'app/models/linked_rails/manifest.rb', line 163 def destroy(iri) Storage.hdel(:persistent, :manifest, URL.as_href(iri)) end |
.move(from, to) ⇒ Object
167 168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'app/models/linked_rails/manifest.rb', line 167 def move(from, to) Storage.hset( :persistent, :redirect_prefix, URL.as_href(from) => URL.as_href(to) ) data = Storage.hget(:persistent, :manifest, URL.as_href(from)) Storage.hset(:persistent, :manifest, URL.as_href(to), data) if data destroy(from) end |
Instance Method Details
#save ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/models/linked_rails/manifest.rb', line 8 def save Storage.hset( :persistent, :manifest, URL.as_href(LinkedRails.iri) => web_manifest.to_json ) end |
#web_manifest ⇒ Object
16 17 18 19 20 21 |
# File 'app/models/linked_rails/manifest.rb', line 16 def web_manifest web_manifest_base.merge( ontola: web_manifest_ontola_section, serviceworker: web_manifest_sw_section ) end |