Class: SolrHit

Inherits:
Delegator
  • Object
show all
Defined in:
app/models/solr_hit.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(document) ⇒ SolrHit

Returns a new instance of SolrHit.



15
16
17
18
19
# File 'app/models/solr_hit.rb', line 15

def initialize(document)
  document = document.with_indifferent_access
  super
  @document = document
end

Instance Attribute Details

#documentObject (readonly)

Returns the value of attribute document.



13
14
15
# File 'app/models/solr_hit.rb', line 13

def document
  @document
end

Instance Method Details

#__getobj__Object Also known as: static_config



3
4
5
# File 'app/models/solr_hit.rb', line 3

def __getobj__
  @document # return object we are delegating to, required
end

#__setobj__(obj) ⇒ Object



9
10
11
# File 'app/models/solr_hit.rb', line 9

def __setobj__(obj)
  @document = obj
end

#idObject



21
22
23
# File 'app/models/solr_hit.rb', line 21

def id
  document[Hyrax.config.id_field]
end