Module: CurationConcern::Curatable
- Extended by:
- ActiveSupport::Concern
- Included in:
- Work
- Defined in:
- app/models/concerns/curation_concern/curatable.rb
Overview
Replaces Curate’s CurationConcern::Model
Instance Method Summary collapse
- #as_json(options) ⇒ Object
- #as_rdf_object ⇒ Object
- #can_be_member_of_collection?(collection) ⇒ Boolean
-
#to_partial_path ⇒ Object
Returns a string identifying the path associated with the object.
- #to_s ⇒ Object
- #to_solr(solr_doc = {}, opts = {}) ⇒ Object
Instance Method Details
#as_json(options) ⇒ Object
22 23 24 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 22 def as_json() { pid: pid, title: title, model: self.class.to_s, curation_concern_type: human_readable_type } end |
#as_rdf_object ⇒ Object
26 27 28 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 26 def as_rdf_object RDF::URI.new(internal_uri) end |
#can_be_member_of_collection?(collection) ⇒ Boolean
47 48 49 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 47 def can_be_member_of_collection?(collection) collection == self ? false : true end |
#to_partial_path ⇒ Object
Returns a string identifying the path associated with the object. ActionPack uses this to find a suitable partial to represent the object.
43 44 45 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 43 def to_partial_path "curation_concern/#{super}" end |
#to_s ⇒ Object
38 39 40 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 38 def to_s title.join(', ') end |
#to_solr(solr_doc = {}, opts = {}) ⇒ Object
30 31 32 33 34 35 36 |
# File 'app/models/concerns/curation_concern/curatable.rb', line 30 def to_solr(solr_doc={}, opts={}) super.tap do |solr_doc| index_collection_pids(solr_doc) solr_doc[Solrizer.solr_name('noid', Sufia::GenericFile.noid_indexer)] = noid add_derived_date_created(solr_doc) end end |