Class: OcrChallenge::IBusinessCardParser

Inherits:
Object
  • Object
show all
Includes:
BasicLandAndCellNumberParser, EmailParser, NameParser
Defined in:
lib/ocr_challenge/i_business_card_parser.rb

Constant Summary

Constants included from EmailParser

EmailParser::EMAIL_REGEX

Constants included from BasicLandAndCellNumberParser

BasicLandAndCellNumberParser::FAX_REGEX

Constants included from BasicTenDigitTelecomParser

BasicTenDigitTelecomParser::BASIC_NUMBER_REGEX

Class Method Summary collapse

Instance Method Summary collapse

Methods included from NameParser

#parse_names

Methods included from EmailParser

#parse_email_addresses

Methods included from BasicLandAndCellNumberParser

#parse_phone_numbers

Methods included from BasicTenDigitTelecomParser

#get_matches

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