Last active
September 7, 2016 22:20
-
-
Save hughevans/a7f38f348b946aa8cd6b696a168dab76 to your computer and use it in GitHub Desktop.
Apple’s TOP SECRET product naming generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def prefix | |
%w{Apple i Air Car Magic}.sample if rand(2) == 1 | |
end | |
def middle | |
%w{Mac MacBook Pad Pod Pod Phone Mouse Watch Play}.sample | |
end | |
def ending | |
%w{Pro S SE Retina Air Plus}.sample if rand(2) == 1 | |
end | |
def generate_names | |
[prefix, middle, ending].compact | |
end | |
def namify | |
if (name = generate_names).size > 1 | |
name.join(' ') | |
else | |
namify | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> 10.times { puts namify } | |
Apple MacBook S | |
Magic MacBook Air | |
Apple Phone | |
Air Phone | |
Air Pad Pro | |
Car Pod Pro | |
Car Mac | |
Phone Air | |
Watch SE | |
Magic Play |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment