Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/nflorentin/vaporizer
Browse files Browse the repository at this point in the history
  • Loading branch information
nflorentin committed Mar 26, 2015
2 parents 948ddfe + 5cffb48 commit 1b018bb
Showing 1 changed file with 98 additions and 2 deletions.
100 changes: 98 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,106 @@ And then execute:
Or install it yourself as:

$ gem install vaporizer

## Good to know

## Usage
Some things to know before using this gem:
* This is my first gem, please be tolerant
* Leafly API is kind of inconsistent and do not respect rules of JSON API standard, that's not my fault
* Changes in Leafly API could break this gem, if it happens, do not hesitate to open an issue and I will fix it as fast as possible
* Vaporizer returns pure parsed JSON and do not wrap results with objects
* If you need more functionalities, do not hesitate to contact me and we will discuss it

TODO: Write usage instructions here
## Configuration

```ruby
require 'vaporizer'

Vaporizer.configure do |config|
config.app_id = "YOUR_APP_ID"
config.app_key = "YOUR_APP_KEY"
config.timeout = 3 # timeout for the requests, optional, in seconds
end
```
## Usage examples

These examples are a bit minimalist but you can of course pass more arguments to the methods

### Strains

**search**
```ruby
Vaporizer::Strain.search(search: 'dream', page: 0, take: 10)
```

**more complex search**
```ruby
Vaporizer::Strain.search(
filters: {
flavors: ['blueberry'],
conditions: ['anxiety']
},
search: '',
page: 0, take: 10
)
```

**details**
```ruby
Vaporizer::Strain.details('la-confidential') # argument is a slug of strain's name
```

**reviews**
```ruby
Vaporizer::Strain.reviews('la-confidential', { page: 0, take: 3 })
```

**review details**
```ruby
Vaporizer::Strain.review_details('la-confidential', 2836) # 2nd argument is the review id
```

**photos**
```ruby
Vaporizer::Strain.photos('la-confidential', { page: 0, take: 4 })
```

**availabilities**
```ruby
Vaporizer::Strain.availabilities('la-confidential', { lat: 33.5, lon: -117.6 })
```

### Locations

**search**
```ruby
Vaporizer::Location.search(latitude: 47.606, longitude: -122.333, page: 0, take: 5)
```

**details**
```ruby
Vaporizer::Location.details('papa-ganja')
```

**menu**
```ruby
Vaporizer::Location.menu('papa-ganja')
```

**reviews**
```ruby
Vaporizer::Location.reviews('papa-ganja', { take: 3, skip: 0})
```

**specials**
```ruby
Vaporizer::Location.specials('papa-ganja')
```

## More options

To have the list of all params and filters available of the Leafly API, please refer to
the <a href="https://developer.leafly.com/docs">official documentation</a>

## Contributing

Expand Down

0 comments on commit 1b018bb

Please sign in to comment.