Skip to content

Instantly share code, notes, and snippets.

@reddavis
Created July 5, 2010 18:37
Show Gist options
  • Save reddavis/464584 to your computer and use it in GitHub Desktop.
Save reddavis/464584 to your computer and use it in GitHub Desktop.
class BinaryBumi
class << self
def translate(actions)
new.translate(actions)
end
end
def translate(actions)
actions.split("").each do |action|
puts action.to_i == 1 ? "Phone" : "Sleep"
end
end
end
BinaryBumi.translate("0101001010")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment