Module: BioPortal::Acts::InstanceMethods
- Defined in:
- lib/bioportal.rb
Instance Method Summary collapse
- #concept(options = {}) ⇒ Object
- #concept_uri ⇒ Object
- #concept_uri=(value) ⇒ Object
- #ncbi_id ⇒ Object
- #ncbi_uri ⇒ Object
- #ontology_id ⇒ Object
- #ontology_id=(value) ⇒ Object
Instance Method Details
#concept(options = {}) ⇒ Object
34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/bioportal.rb', line 34 def concept ={} [:apikey] ||= self.bioportal_api_key unless self.bioportal_api_key.nil? return nil if self.bioportal_concept.nil? begin return self.bioportal_concept.get_concept rescue Exception=>e return nil end end |
#concept_uri ⇒ Object
66 67 68 69 |
# File 'lib/bioportal.rb', line 66 def concept_uri return nil if self.bioportal_concept.nil? return self.bioportal_concept.concept_uri end |
#concept_uri=(value) ⇒ Object
77 78 79 80 |
# File 'lib/bioportal.rb', line 77 def concept_uri= value check_concept self.bioportal_concept.concept_uri=value end |
#ncbi_id ⇒ Object
50 51 52 53 54 55 56 57 |
# File 'lib/bioportal.rb', line 50 def ncbi_id unless ncbi_uri.nil? id = ncbi_uri.split("/").last.split("_").last id.to_i else nil end end |
#ncbi_uri ⇒ Object
46 47 48 |
# File 'lib/bioportal.rb', line 46 def ncbi_uri concept_uri end |
#ontology_id ⇒ Object
60 61 62 63 |
# File 'lib/bioportal.rb', line 60 def ontology_id return nil if self.bioportal_concept.nil? return self.bioportal_concept.ontology_id end |
#ontology_id=(value) ⇒ Object
71 72 73 74 |
# File 'lib/bioportal.rb', line 71 def ontology_id= value check_concept self.bioportal_concept.ontology_id=value end |