Class: Qa::Authorities::Mesh

Inherits:
Object
  • Object
show all
Extended by:
Deprecation
Defined in:
lib/qa/authorities/mesh.rb

Instance Method Summary collapse

Instance Method Details

#full_record(id) ⇒ Object



16
17
18
19
20
21
# File 'lib/qa/authorities/mesh.rb', line 16

def full_record(id)
  @results ||= begin
                 r = Qa::SubjectMeshTerm.where(term_id: id).limit(1).first
                 r.nil? ? nil : {id: r.term_id, label: r.term, synonyms: r.synonyms}
               end
end

#get_full_record(id) ⇒ Object



23
24
25
26
# File 'lib/qa/authorities/mesh.rb', line 23

def get_full_record(id)
  Deprecation.warn(Mesh, "get_full_record is deprecated and will be removed in 0.1.0. Use full_record instead", caller)
  full_record(id)
end

#parse_authority_responseObject

satisfy TermsController



29
30
# File 'lib/qa/authorities/mesh.rb', line 29

def parse_authority_response
end

#resultsObject



5
6
7
8
9
10
# File 'lib/qa/authorities/mesh.rb', line 5

def results
  @results ||= begin
                 r = Qa::SubjectMeshTerm.where('term_lower LIKE ?', "#{@q}%").limit(10)
                 r.map { |t| {id: t.term_id, label: t.term} }
               end
end

#search(q, sub_authority = nil) ⇒ Object



12
13
14
# File 'lib/qa/authorities/mesh.rb', line 12

def search(q, sub_authority=nil)
  @q = q
end