ifeelgoods/keen-gem — pull request #2 by mtparet (2013-06-11 13:21:09+00:00)
Title: [Feature] Managing saved queries

### Overview

With the current state of the keen-gem, this is not possible to manage saved queries.
To achieve this we need an object to represent a query, access to settings outside of the client class and share helpers methods.

Except the access and configuration of the settings the Gem, these modifications not changed any others current behaviors

### Managing saved queries

Managing saved queries require MASTER_ID.

To save a query, instead of calling your query:

```ruby
Keen.sum("purchases", :target_property => "price")
```
You need to pass the name of query as the first parameter to the Keen::Query initializer and call the save method on this query:
```ruby
Keen::Query.new('count','purchases', :target_property => "price").save('name_of_the_query')
```

To executed a saved query:

```ruby
Keen::Query.new.saved('name_saved_query')
```

Create a query:
```ruby
query = Keen::Query.new(query_name, event_collection, params)
```

Execute the query:
```ruby
query.execute
```

Save the query:
```ruby
query.save('name')
```

Return the result of a saved query
```ruby
Keen::Query.new.saved('name_saved_query')
```

Delete a query
```ruby
Keen::Query.new.delete('name_saved_query')
```

### Other changes

To configure the gem, you have to use config method on Keen instead of directly call the setting.
Keen.config.setting = value

The config variables are now stored in a Config class.
Helpers methods moved to helpers file.