Class: BioportalConcept

Inherits:
ActiveRecord::Base
  • Object
show all
Includes:
BioPortal::RestAPI
Defined in:
app/models/bioportal_concept.rb

Instance Method Summary collapse

Methods included from BioPortal::RestAPI

#fetch_json, #populate_ontology_details, #search

Instance Method Details

#bioportal_base_rest_urlObject

the base url is defined by the associated class - this overrides the method in the RestAPI mixin



25
26
27
# File 'app/models/bioportal_concept.rb', line 25

def bioportal_base_rest_url
  conceptable.bioportal_base_rest_url
end

#get_concept(options = {}) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'app/models/bioportal_concept.rb', line 8

def get_concept options={}
  options[:refresh]||=false
  
  refresh=options.delete(:refresh)
  
  concept=nil
  concept = YAML::load(cached_concept_yaml) unless (refresh || cached_concept_yaml.nil?)
  unless concept      
    concept = super(self.ontology_id,self.concept_uri,options)
    update_attribute(:cached_concept_yaml, concept.to_yaml)
  end
    
  concept
end