An implementation of the Torn V2 API using Ruby.
Install the gem and add to the application's Gemfile by executing:
bundle add torn_ruby
If bundler is not being used to manage dependencies, install the gem by executing:
gem install torn_ruby
To use the TornRuby gem, you’ll need a valid Torn API key.
require "torn_ruby"
api_key = "Valid Torn Api Key"
client = TornRuby::Client.new(api_key:)
# Fetch basic data
user = client.user
puts user.name # => "YourTornName"
# Fetch specific selections by passing symbols
user = client.user(selections: [:profile])
# Some endpoints require you to specify a path
racing = client.racing(path: :carupgrades)
Bug reports and pull requests are welcome on GitHub at https://github.com/ibramsterdam/torn_ruby.
The gem is available as open source under the terms of the MIT License.
Everyone interacting in the TornRuby project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.