Skip to content

Instantly share code, notes, and snippets.

@raclettes
Last active February 22, 2017 18:56
Show Gist options
  • Save raclettes/86c8cb0d2c0cc013c5368d64594fc064 to your computer and use it in GitHub Desktop.
Save raclettes/86c8cb0d2c0cc013c5368d64594fc064 to your computer and use it in GitHub Desktop.
It's new Ruby, it's Tie
# Ruby is this:
print "name?: "
name = gets.chomp
puts "Hi #{name}"
# Tie is this, yes its type safe, but not OOP:
gets "name?: " |> name # string is inferred due to gets returning string
puts "Hi #{name}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment