class Fullname

Attributes

first[R]
last[R]

Public Class Methods

new(first, last = nil) click to toggle source
# File activerecord/test/models/customer.rb, line 78
def initialize(first, last = nil)
  @first, @last = first, last
end
parse(str) click to toggle source
# File activerecord/test/models/customer.rb, line 68
def self.parse(str)
  return nil unless str

  if str.is_a?(Hash)
    new(str[:first], str[:last])
  else
    new(*str.to_s.split)
  end
end

Public Instance Methods

to_s() click to toggle source
# File activerecord/test/models/customer.rb, line 82
def to_s
  "#{first} #{last.upcase}"
end