class Qa::Authorities::Mesh
Public Instance Methods
Source
# File lib/qa/authorities/mesh.rb, line 13 def all r = Qa::SubjectMeshTerm.all r.map { |t| { id: t.term_id, label: t.term } } end
Source
# File lib/qa/authorities/mesh.rb, line 8 def find(id) r = Qa::SubjectMeshTerm.where(term_id: id).limit(1).first r.nil? ? nil : { id: r.term_id, label: r.term, synonyms: r.synonyms } end
Source
# File lib/qa/authorities/mesh.rb, line 3 def search(q) r = Qa::SubjectMeshTerm.where('term_lower LIKE ?', "#{q}%").limit(10) r.map { |t| { id: t.term_id, label: t.term } } end