Class: OcrChallenge::IBusinessCardParser
- Inherits:
-
Object
- Object
- OcrChallenge::IBusinessCardParser
- Includes:
- BasicLandAndCellNumberParser, EmailParser, NameParser
- Defined in:
- lib/ocr_challenge/i_business_card_parser.rb
Constant Summary
Constants included from EmailParser
Constants included from BasicLandAndCellNumberParser
BasicLandAndCellNumberParser::FAX_REGEX
Constants included from BasicTenDigitTelecomParser
BasicTenDigitTelecomParser::BASIC_NUMBER_REGEX
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(document) ⇒ IBusinessCardParser
constructor
A new instance of IBusinessCardParser.
Methods included from NameParser
Methods included from EmailParser
Methods included from BasicLandAndCellNumberParser
Methods included from BasicTenDigitTelecomParser
Constructor Details
#initialize(document) ⇒ IBusinessCardParser
Returns a new instance of IBusinessCardParser.
11 12 13 |
# File 'lib/ocr_challenge/i_business_card_parser.rb', line 11 def initialize(document) @lines = document.split("\n").reject { |line| line.empty? } end |
Class Method Details
.get_contact_info(document) ⇒ Object
6 7 8 9 |
# File 'lib/ocr_challenge/i_business_card_parser.rb', line 6 def self.get_contact_info(document) parser = new(document) IContactInfo.new(parser) end |