Class: Decidim::DirectVerifications::Parsers::NameParser
- Inherits:
-
BaseParser
- Object
- BaseParser
- Decidim::DirectVerifications::Parsers::NameParser
show all
- Defined in:
- lib/decidim/direct_verifications/parsers/name_parser.rb
Constant Summary
collapse
- LINE_DELIMITER =
/[\r\n;,]/.freeze
- NON_ALPHA_CHARS =
/[^[:print:]]|["$<>|\\]/.freeze
Constants inherited
from BaseParser
BaseParser::EMAIL_REGEXP
Instance Method Summary
collapse
Methods inherited from BaseParser
#initialize, #to_h
Instance Method Details
10
11
12
|
# File 'lib/decidim/direct_verifications/parsers/name_parser.rb', line 10
def
nil
end
|
#lines ⇒ Object
14
15
16
|
# File 'lib/decidim/direct_verifications/parsers/name_parser.rb', line 14
def lines
txt.split(LINE_DELIMITER)
end
|
#parse_data(email, line, _header) ⇒ Object
18
19
20
21
22
|
# File 'lib/decidim/direct_verifications/parsers/name_parser.rb', line 18
def parse_data(email, line, )
name = parse_name(email, line)
name = strip_non_alpha_chars(name)
name.presence || fallback_name(email)
end
|