Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alextoul/f4417bab1a33d09971b321938ba6af67 to your computer and use it in GitHub Desktop.
Save alextoul/f4417bab1a33d09971b321938ba6af67 to your computer and use it in GitHub Desktop.
Decathlon-Sports-RubyGem-HelloWorld-attempt.rb
#!/usr/bin/ruby
#
# Hello Word script to execute the 'decathlon-sports' Ruby Gem
#
#
# GOAL: Suggest the user a sport to practice knowing he loves snowboarding
#
gem 'decathlon-sports'
# Get the list of Decathlon Sports
sports = Decathlon::Sports.all
# => uninitialized constant Decathlon (NameError)
# Find snowboard
snowboard = Decathlon::Sports.find(73)
# Find suggested sport
suggested_sports = Decathlon::Sports::Recommendations.get(snowboard.id)
printf "We suggest you practice %d because you love snowboarding\n", suggested_sports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment