Skip to content

Instantly share code, notes, and snippets.

# Rails Startup Template
# note - requires gem thor
# Call with rails new <app_name> -m <template_PATH>
# Always use development gems
gem_group :development do
gem "pry-rails"
gem 'pry-byebug'
gem "quiet_assets"
# Q: Define a function to find the hypotenuse of a right triangle with side lengths a and b
# A:
def hypotenuse(a, b)
# Return the hypotenuse of a triangle with lenght a and height b.
return Math.sqrt(a **2 + b **2)
end
# Q: What methods do strings have that symbols don't? Describe a few. What methods do symbols have that strings don't?
# A: join, reverse, strip, chomp, sub - strings have many methods focused on manipulating strings