Skip to content

Instantly share code, notes, and snippets.

@rodloboz
Last active June 26, 2018 03:59
Show Gist options
  • Save rodloboz/c1db7c78f4b40747eef64efeba69e712 to your computer and use it in GitHub Desktop.
Save rodloboz/c1db7c78f4b40747eef64efeba69e712 to your computer and use it in GitHub Desktop.
# "Hello" # string
# true # boolean
# false # boolean
# 3 # integer
# 3.14 # float
# ["Hello", 3, 3.14, true] # array
# (1..10) # range
# # String interpolation
# name = "Rui"
# "Hello, #{name}"
# methods
def say_hello(name)
puts "Hello, #{name.capitalize}."
end
name2 = "Mike"
# puts "Hello, John"
# puts "Hello, Ringo"
# puts "Hello, Tango"
# puts "Hello, Cash"
# prints Hello + a name
# john = "john"
say_hello("john")
say_hello("tango")
require 'date'
def max(x, y)
if x > y
return x
elsif x < y
y
else
false
end
"hello"
end
first_number = 1
second_number = 2
#. x , y
puts max(9, second_number)
def tomorrow
tomorrow_date = Date.today + 1
# format time
tomorrow_date.strftime("%d %B %Y")
end
puts tomorrow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment