Class: Qa::Authorities::Mesh

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

Instance Method Summary collapse

Constructor Details

#initialize(q, sub_authority = nil) ⇒ Mesh

Returns a new instance of Mesh.



4
5
6
# File 'lib/qa/authorities/mesh.rb', line 4

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

Instance Method Details

#parse_authority_responseObject

satisfy TermsController



16
17
# File 'lib/qa/authorities/mesh.rb', line 16

def parse_authority_response
end

#resultsObject



8
9
10
11
12
13
# File 'lib/qa/authorities/mesh.rb', line 8

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