class Qa::Authorities::Mesh

Public Instance Methods

all() click to toggle 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
find(id) click to toggle 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