module Pirateme

Constants

VERSION

Public Class Methods

hello() click to toggle source
# File lib/Pirateme.rb, line 6
def self.hello
  "Welcome to the coolest pirate gem!"
end
piratize(arg) click to toggle source
# File lib/Pirateme.rb, line 18
def self.piratize(arg)

  # translator library
  translator =
  {
    "address" => "port o' call",
    "admin" => "helm",
    "am" => "be",
    "an" => "a",
    "and" => "n'",
    "are" => "be",
    "award" => "prize",
    "beer" => "grog",
    "before" => "afore",
    "belief" => "creed",
    "between" => "betwixt",
    "big" => "vast",
    "boy" => "lad",
    "boss" => "admiral",
    "bourbon" => "rum",
    "box" => "barrel",
    "business" => "company",
    "businesses" => "companies",
    "calling" => "callin'",
    "canada" => "Great North",
    "cash" => "doubloons",
    "cheat" => "hornswaggle",
    "comments" => "yer words",
    "country" => "land",
    "dashboard" => "shanty",
    "disconnect" => "keelhaul",
    "do" => "d'",
    "dollar" => "doubloon",
    "dude" => "pirate",
    "employee" => "crew",
    "everyone" => "all hands",
    "eye" => "eye-patch",
    "family" => "kin",
    "fee" => "debt",
    "female" => "wench",
    "for" => "fer",
    "friend" => "shipmate",
    "gin" => "rum",
    "girl" => "lass",
    "girls" => "lassies",
    "go" => "sail",
    "good" => "jolly good",
    "group" => "maties",
    "hand" => "hook",
    "hello" => "ahoy",
    "hey" => "ahoy",
    "hotel" => "inn",
    "i'm" => "i be",
    "internet" => "series o' tubes",
    "invalid" => "sunk",
    "is" => "be",
    "island" => "isle",
    "isn't" => "be not",
    "it's" => "'tis",
    "jail" => "brig",
    "kill" => "keelhaul",
    "king" => "king",
    "leg" => "peg",
    "lady" => "lass",
    "logout" => "walk the plank",
    "male" => "pirate",
    "man" => "pirate",
    "manager" => "admiral",
    "money" => "doubloons",
    "month" => "moon",
    "my" => "me",
    "never" => "nary",
    "no" => "nay",
    "of" => "o'",
    "over" => "o'er",
    "page" => "parchment",
    "person" => "scallywag",
    "posted" => "tacked to the yardarm",
    "president" => "king",
    "prison" => "brig",
    "quickly" => "smartly",
    "really" => "verily",
    "relatives" => "kin",
    "religion" => "creed",
    "ring" => "ring",
    "role" => "job",
    "say" => "cry",
    "seconds" => "ticks o' tha clock",
    "shipping" => "cargo",
    "small" => "puny",
    "soldier" => "sailor",
    "sorry" => "yarr",
    "spouse" => "ball 'n' chain",
    "state" => "land",
    "supervisor" => "Cap'n",
    "that's" => "that be",
    "the" => "tha",
    "them" => "'em",
    "thing" => "thing",
    "this" => "dis",
    "to" => "t'",
    "vodka" => "rum",
    "we" => "our jolly crew",
    "we're" => "we's",
    "wine" => "grog",
    "whiskey" => "rum",
    "whisky" => "rum",
    "with" => "wit'",
    "woman" => "wench",
    "work" => "duty",
    "yah" => "aye",
    "yeah" => "aye",
    "yes" => "aye",
    "you" => "ye",
    "you're" => "you be",
    "you've" => "ye",
    "your" => "yer"
  }
  pirate_change = []
  arg.split(" ").map do |word|
  if word.downcase!
  end
    if translator.has_key? word
      word = translator[word]

      pirate_change.push(word)
    else

      pirate_change.push(word)
    end
  end
  pirate_change.join(" ").capitalize
end
translate(arg) click to toggle source
# File lib/Pirateme.rb, line 10
def self.translate(arg)
  if arg.is_a?(String)
    piratize(arg)
  else
    "Need a string matey!"
  end
end