class Namie::Name
The Name
!
Attributes
first[RW]
firstname[RW]
last[RW]
lastname[RW]
middle[RW]
middlenames[RW]
suffix[RW]
title[RW]
Public Class Methods
new(*args)
click to toggle source
# File lib/namie/name.rb, line 6 def initialize(*args) @title, @first, *@middle, @last, @suffix = Namie::Parser.new(args).args end
Public Instance Methods
==(other)
click to toggle source
# File lib/namie/name.rb, line 22 def ==(other) fullname == other.fullname end
aka()
click to toggle source
# File lib/namie/name.rb, line 26 def aka match = [first, middle, last].join.match(/['"](\w*)['"]/) match && match[1] end
fullname()
click to toggle source
# File lib/namie/name.rb, line 31 def fullname to_s end
shortname()
click to toggle source
# File lib/namie/name.rb, line 35 def shortname to_s(:short) end
to_s(fmt = nil)
click to toggle source
# File lib/namie/name.rb, line 39 def to_s(fmt = nil) Namie::Formatter.new(self, fmt).to_s end
valid?()
click to toggle source
# File lib/namie/name.rb, line 18 def valid? !first.empty? end