Class: CurationConcerns::SolrDocumentBehavior::ModelWrapper
- Inherits:
-
Object
- Object
- CurationConcerns::SolrDocumentBehavior::ModelWrapper
- Defined in:
- app/models/concerns/curation_concerns/solr_document_behavior.rb
Instance Method Summary collapse
-
#initialize(model, id) ⇒ ModelWrapper
constructor
A new instance of ModelWrapper.
- #model_name ⇒ Object
- #persisted? ⇒ Boolean
- #to_global_id ⇒ Object
- #to_param ⇒ Object
- #to_partial_path ⇒ Object
Constructor Details
#initialize(model, id) ⇒ ModelWrapper
Returns a new instance of ModelWrapper.
21 22 23 24 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 21 def initialize(model, id) @model = model @id = id end |
Instance Method Details
#model_name ⇒ Object
34 35 36 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 34 def model_name @model.model_name end |
#persisted? ⇒ Boolean
26 27 28 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 26 def persisted? true end |
#to_global_id ⇒ Object
42 43 44 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 42 def to_global_id URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id end |
#to_param ⇒ Object
30 31 32 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 30 def to_param @id end |
#to_partial_path ⇒ Object
38 39 40 |
# File 'app/models/concerns/curation_concerns/solr_document_behavior.rb', line 38 def to_partial_path @model._to_partial_path end |