Skip to content

Instantly share code, notes, and snippets.

@nemrosim
Last active August 28, 2019 10:36
Show Gist options
  • Save nemrosim/854683b339962d54e4b77a81b99893ab to your computer and use it in GitHub Desktop.
Save nemrosim/854683b339962d54e4b77a81b99893ab to your computer and use it in GitHub Desktop.
[Ruby] basics #basics
// vim: syntax=ruby
#Array
adress = [1,2,3,4,5,6]
p adress
p adress[0]
new_adress = adress.reverse!
p new_adress
# Printto console
print "Hello"
puts "Hello world"
p "Hello world"
# METHOD
def say_hello(message)
puts message
end
say_hello("Hello in method")
say_hello "Hello in method v2"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment