2007-01-22 14:43:50 +01:00
|
|
|
class Author < String
|
|
|
|
attr_accessor :ip
|
|
|
|
attr_reader :name
|
|
|
|
def initialize(name, ip = nil)
|
|
|
|
@ip = ip
|
2010-01-05 01:43:27 +01:00
|
|
|
super(name.as_utf8)
|
2007-01-22 14:43:50 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def name=(value)
|
|
|
|
self.gsub!(/.+/, value)
|
|
|
|
end
|
|
|
|
|
|
|
|
alias_method :name, :to_s
|
|
|
|
|
|
|
|
def <=>(other)
|
|
|
|
name <=> other.to_s
|
|
|
|
end
|
|
|
|
end
|