Class: Qa::Authorities::Mesh
- Inherits:
-
Object
- Object
- Qa::Authorities::Mesh
- Defined in:
- lib/qa/authorities/mesh.rb
Instance Method Summary collapse
-
#initialize(q, sub_authority = nil) ⇒ Mesh
constructor
A new instance of Mesh.
-
#parse_authority_response ⇒ Object
satisfy TermsController.
- #results ⇒ Object
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, =nil) @q = q end |
Instance Method Details
#parse_authority_response ⇒ Object
satisfy TermsController
16 17 |
# File 'lib/qa/authorities/mesh.rb', line 16 def end |
#results ⇒ Object
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 |