Has this ever happened to you?
We'll not anymore! With the OneRuby gem you can get a list of all of the LOTR movies and quotes, in your code!
This gem is a wrapper for The One API to Rule Them All.
Installation
Add this line to your application's Gemfile:
gem 'one-ruby-sdk'
And then execute:
$ bundle
Or install it yourself as:
$ gem install one-ruby-sdk
Configuration
Simply set your API Key as below. For Rails, include this in an initializer file. Sign up for a key here
OneRuby.config do |c|
c.api_key = '[PASTE API KEY HERE]'
end
Usage
This gem currently only supports looking up movie data.
Movies
movies = OneRuby::Movie.list
=> [<OneRuby::Movie>]
movie = OneRuby::Movie.find('5cd95395de30eff6ebccde56')
=> <OneRuby::Movie>
movie.id
movie.name
movie.runtime_in_minutes
movie.budget_in_millions
movie.box_office_revenue_in_millions
movie.academy_award_nominations
movie.academy_award_wins
movie.rotten_tomatoes_score
Quotes
quotes = OneRuby::Quote.list('5cd95395de30eff6ebccde5b')
=> [<OneRuby::Quote>]
quotes[0].id
quotes[0].dialog
quotes[0].movie_id
quotes[0].character_id
Coming Soon!
- More objects including characters and books
- Filtering
- Pagination support
Development
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/bgkittrell/Ben_Kittrell-SDK.
License
The gem is available as open source under the terms of the MIT License.