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.
28 29 30 |
# File 'lib/oddb2xml/extractor.rb', line 28 def initialize(xml) @xml = xml end |
Instance Attribute Details
#xml ⇒ Object
Returns the value of attribute xml.
27 28 29 |
# File 'lib/oddb2xml/extractor.rb', line 27 def xml @xml end |
Instance Method Details
#correct_code(pharmacode, length = 7) ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/oddb2xml/extractor.rb', line 31 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 |