An open API service indexing awesome lists of open source software.

https://github.com/dbtlr/google-api-rails

A rails wrapper for the Google API ruby client.
https://github.com/dbtlr/google-api-rails

Last synced: about 1 month ago
JSON representation

A rails wrapper for the Google API ruby client.

Awesome Lists containing this project

README

          

# Google API Wrapper for Ruby on Rails [![](https://travis-ci.org/dbtlr/google-api-rails.png)](https://travis-ci.org/dbtlr/google-api-rails)

This wraps the official [Google Ruby API client](https://github.com/google/google-api-ruby-client). All documentation for interacting with the actual client can be found there.

## Installation

Add the gem to your Gemfile:

```ruby
gem install google-api-rails
```

Create an initializer, for instance google-api-rails.rb with the following:

```ruby
GoogleApi.config do |config|
config.client_id = ""
config.client_secret = ""
config.application_name = ""
end
```

## Getting Started

To use the Ruby API client, simple access it through the wrapper like so:

```ruby
# Make an API call
result = GoogleApi.client.execute(
:api_method => plus.activities.list,
:parameters => {'collection' => 'public', 'userId' => 'me'}
)
```

## About This Gem

I wrote this simply to have the convenience of keeping my Google API config in an initializer, instead of all over my apps. If you know of a better way or see something I missed, feel free to submit an issue or pull request.