Skip to content

Instantly share code, notes, and snippets.

@fables-tales
Forked from andrew/examples.rb
Last active December 15, 2015 01:39
Show Gist options
  • Save fables-tales/5181282 to your computer and use it in GitHub Desktop.
Save fables-tales/5181282 to your computer and use it in GitHub Desktop.
number = 1
string = "andrew"
hash = { "foo" => "bar" }
array = [1,3,2]
symbol = :cheese
range = 1..3
# try puts each variable above
puts string
def swap(argument1, argument2)
[argument2, argument1]
end
class Cheese < String
def reverse
'cheese'
end
end
cheese = Cheese.new('andrew')
cheese.reverse
10.times do |i|
puts i
end
[1,8,9,10].each do |thing_in_list|
puts thing_in_list+1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment