Class: Dataset::Adaptors::Iqvoc::LabelAdaptor
- Inherits:
-
HttpAdaptor
- Object
- HttpAdaptor
- Dataset::Adaptors::Iqvoc::LabelAdaptor
- Defined in:
- app/models/dataset/adaptors/iqvoc/label_adaptor.rb
Instance Method Summary collapse
Instance Method Details
#extract_label(html) ⇒ Object
9 10 11 12 13 14 |
# File 'app/models/dataset/adaptors/iqvoc/label_adaptor.rb', line 9 def extract_label(html) doc = Nokogiri::HTML(html) node = doc.at_css('h1') node.at_css('small').remove node.text.try(:strip) end |
#find(concept_url) ⇒ Object
2 3 4 5 6 7 |
# File 'app/models/dataset/adaptors/iqvoc/label_adaptor.rb', line 2 def find(concept_url) path = URI.parse(concept_url).path if response = http_get(path) extract_label(response.body) end end |