Giter Site home page Giter Site logo

one-ruby-sdk's Introduction

Has this ever happened to you?

One does not simply

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

# Get a list of ALL the LOTR movies
movies = OneRuby::Movie.list
=> [<OneRuby::Movie>]

# Get details about a single movie
movie = OneRuby::Movie.find('5cd95395de30eff6ebccde56')
=> <OneRuby::Movie>

movie.id #=> '5cd95395de30eff6ebccde56'
movie.name #=> 'The Lord of the Rings Series'
movie.runtime_in_minutes #=> 558
movie.budget_in_millions #=> 281
movie.box_office_revenue_in_millions #=> 2917
movie.academy_award_nominations #=> 30
movie.academy_award_wins #=> 17
movie.rotten_tomatoes_score #=> 94

Quotes

# Get a list of quotes from a movie
quotes = OneRuby::Quote.list('5cd95395de30eff6ebccde5b')
=> [<OneRuby::Quote>]

quotes[0].id #=> '5cd95395de30eff6ebccde56'
quotes[0].dialog #=> 'Man Flesh!'
quotes[0].movie_id #=> '5cd95395de30eff6ebccde50'
quotes[0].character_id #=> '5cd95395de30eff6ebccde51'

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/one-ruby-sdk.

License

The gem is available as open source under the terms of the MIT License.

one-ruby-sdk's People

Contributors

bgkittrell avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.