Skip to content

Instantly share code, notes, and snippets.

@dinjas
Last active December 14, 2018 03:23
Show Gist options
  • Save dinjas/adde8ed92374311b5dbb to your computer and use it in GitHub Desktop.
Save dinjas/adde8ed92374311b5dbb to your computer and use it in GitHub Desktop.
Why dinjas?
# Usage:
# >> Namer.new("Jason Dinsmore").computer_name
# => "dinjas"
require 'concord'
class Namer
include Concord.new(:full_name)
def computer_name
names
.map(&method(:translate))
.reverse
.join
end
def names
full_name.split
end
def translate(str)
str.downcase.slice(0, 3)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment