Class: Poopypants::Name

Inherits:
Object
  • Object
show all
Defined in:
lib/poopypants.rb

Constant Summary collapse

FIRSTS =
{"A" => "Stinky", "B" => "Lumpy", "C" => "Buttercup", "D" => "Gidget", "E" => "Crusty", "F" => "Greasy", "G" => "Fluffy", "H" => "Cheeseball", "I" => "Chim-Chim", "J" => "Poopsie", "K" => "Flunky", "L" => "Booger", "M" => "Pinky", "N" => "Zippy", "O" => "Goober", "P" => "Doofus", "Q" => "Slimy", "R" => "Loopy", "S" => "Snotty", "T" => "Falafel", "U" => "Dorky", "V" => "Squeezit", "W" => "Oprah", "X" => "Skipper", "Y" => "Dinky", "Z" => "Zsa-Zsa"}.freeze
MIDDLES =
{"A" => "Diaper", "B" => "Toilet", "C" => "Giggle", "D" => "Bubble", "E" => "Girdle", "F" => "Barf", "G" => "Lizard", "H" => "Waffle", "I" => "Cootie", "J" => "Monkey", "K" => "Potty", "L" => "Liver", "M" => "Banana", "N" => "Rhino", "O" => "Burger", "P" => "Hamster", "Q" => "Toad", "R" => "Gizzard", "S" => "Pizza", "T" => "Gerbil", "U" => "Chicken", "V" => "Pickle", "W" => "Chuckle", "X" => "Tofu", "Y" => "Gorilla", "Z" => "Stinker"}.freeze
LASTS =
{"A" => "head", "B" => "mouth", "C" => "face", "D" => "nose", "E" => "tush", "F" => "breath", "G" => "pants", "H" => "shorts", "I" => "lips", "J" => "honker", "K" => "butt", "L" => "brain", "M" => "tushie", "N" => "chunks", "O" => "hiney", "P" => "biscuits", "Q" => "toes", "R" => "buns", "S" => "fanny", "T" => "sniffer", "U" => "sprinkles", "V" => "kisser", "W" => "squirt", "X" => "humperdinck", "Y" => "brains", "Z" => "juice"}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(first, last) ⇒ Name

Returns a new instance of Name.



11
12
13
14
# File 'lib/poopypants.rb', line 11

def initialize(first, last)
  @first = first.gsub(/\W+|\d+|_/, '')
  @last = last.gsub(/\W+|\d+|_/, '')
end

Instance Attribute Details

#firstObject

Returns the value of attribute first.



9
10
11
# File 'lib/poopypants.rb', line 9

def first
  @first
end

#lastObject

Returns the value of attribute last.



9
10
11
# File 'lib/poopypants.rb', line 9

def last
  @last
end

Instance Method Details

#poopifyObject



16
17
18
# File 'lib/poopypants.rb', line 16

def poopify
  new_name unless @first.empty? || @last.empty?
end