Class: Hyrax::SolrDocumentBehavior::ModelWrapper
- Inherits:
-
Object
- Object
- Hyrax::SolrDocumentBehavior::ModelWrapper
- Defined in:
- app/models/concerns/hyrax/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.
32 33 34 35 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 32 def initialize(model, id) @model = model @id = id end |
Instance Method Details
#model_name ⇒ Object
45 46 47 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 45 def model_name @model.model_name end |
#persisted? ⇒ Boolean
37 38 39 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 37 def persisted? true end |
#to_global_id ⇒ Object
53 54 55 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 53 def to_global_id URI::GID.build app: GlobalID.app, model_name: model_name.name, model_id: @id end |
#to_param ⇒ Object
41 42 43 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 41 def to_param @id end |
#to_partial_path ⇒ Object
49 50 51 |
# File 'app/models/concerns/hyrax/solr_document_behavior.rb', line 49 def to_partial_path @model._to_partial_path end |