Created
January 3, 2019 17:21
-
-
Save alextoul/f4417bab1a33d09971b321938ba6af67 to your computer and use it in GitHub Desktop.
Decathlon-Sports-RubyGem-HelloWorld-attempt.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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