summaryrefslogtreecommitdiff
path: root/lib/nil_person.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/nil_person.rb')
-rw-r--r--lib/nil_person.rb31
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/nil_person.rb b/lib/nil_person.rb
new file mode 100644
index 0000000..30a175f
--- /dev/null
+++ b/lib/nil_person.rb
@@ -0,0 +1,31 @@
+# frozen_string_literal: true
+
+class NilPerson
+ def name
+ nil
+ end
+
+ def father
+ self
+ end
+
+ def mother
+ self
+ end
+
+ def gender
+ nil
+ end
+
+ def ==(other)
+ other.is_a?(NilPerson)
+ end
+
+ def eql?(other)
+ self == other
+ end
+
+ def to_s
+ ''
+ end
+end