Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (20 sloc) 0.465 kb
class Person
attr_accessor :name, :group, :email, :santa
def initialize(attrs)
self.name = attrs["name"]
self.group = attrs["group"]
self.email = attrs["email"]
end
def can_be_santa_of?(other)
group != other.group
end
def can_swap_santas_with?(other)
santa.can_be_santa_of?(other) && other.santa.can_be_santa_of?(self)
end
def to_s
"#{name} (#{group})"
end
def with_santa
"#{self} - santa: #{santa}"
end
end
Jump to Line
Something went wrong with that request. Please try again.