Class: NameParser::Parser

Inherits:
Object
  • Object
show all
Includes:
Patterns
Defined in:
lib/name_parser/parser.rb

Constant Summary

Constants included from Patterns

NameParser::Patterns::EDUCATOR, NameParser::Patterns::LAST_NAME_PATTERN, NameParser::Patterns::LEGAL, NameParser::Patterns::MEDICINE, NameParser::Patterns::MILITARY, NameParser::Patterns::NAME_PATTERN, NameParser::Patterns::POLICE, NameParser::Patterns::POLITICIAN, NameParser::Patterns::RELIGIOUS, NameParser::Patterns::ROYALTY, NameParser::Patterns::STANDARD, NameParser::Patterns::SUFFIX_PATTERN, NameParser::Patterns::TITLE_PATTERN

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Parser

Returns a new instance of Parser.



7
8
9
10
# File 'lib/name_parser/parser.rb', line 7

def initialize(name)
  @name = name.dup
  run
end

Instance Attribute Details

#firstObject (readonly)

Returns the value of attribute first.



5
6
7
# File 'lib/name_parser/parser.rb', line 5

def first
  @first
end

#lastObject (readonly)

Returns the value of attribute last.



5
6
7
# File 'lib/name_parser/parser.rb', line 5

def last
  @last
end

#middleObject (readonly)

Returns the value of attribute middle.



5
6
7
# File 'lib/name_parser/parser.rb', line 5

def middle
  @middle
end

#suffixObject (readonly)

Returns the value of attribute suffix.



5
6
7
# File 'lib/name_parser/parser.rb', line 5

def suffix
  @suffix
end

#titleObject (readonly)

Returns the value of attribute title.



5
6
7
# File 'lib/name_parser/parser.rb', line 5

def title
  @title
end