Class: Oddb2xml::Extractor
- Inherits:
-
Object
- Object
- Oddb2xml::Extractor
- Defined in:
- lib/oddb2xml/extractor.rb
Direct Known Subclasses
BMUpdateExtractor, BagXmlExtractor, EphaExtractor, LppvExtractor, MedregbmExtractor, MigelExtractor, SwissIndexExtractor, SwissmedicExtractor, SwissmedicInfoExtractor, ZurroseExtractor
Instance Attribute Summary collapse
-
#xml ⇒ Object
Returns the value of attribute xml.
Instance Method Summary collapse
- #correct_code(pharmacode, length = 7) ⇒ Object
-
#initialize(xml) ⇒ Extractor
constructor
A new instance of Extractor.
Constructor Details
#initialize(xml) ⇒ Extractor
Returns a new instance of Extractor.
24 25 26 |
# File 'lib/oddb2xml/extractor.rb', line 24 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object
Returns the value of attribute xml.
23 24 25 |
# File 'lib/oddb2xml/extractor.rb', line 23 def xml @xml end |
Instance Method Details
#correct_code(pharmacode, length = 7) ⇒ Object
27 28 29 30 31 32 33 |
# File 'lib/oddb2xml/extractor.rb', line 27 def correct_code(pharmacode, length=7) if pharmacode.length != length # restore zero at the beginnig ("%0#{length}i" % pharmacode.to_i) else pharmacode end end |