Leaflyapi
A simple ruby gem to help you enteract with the leafly.com API.
Currently it lets you retrieve strains and read their attributes but it may do more eventually.
Installation
Add this line to your application's Gemfile:
gem 'leaflyapi'
And then execute:
$ bundle
Or install it yourself as:
$ gem install leaflyapi
Usage
require 'leaflyapi'
# lets get ALL of the strains
strains = Leaflyapi::Strains.all
# now we have an array full of strain objects
strains.class => Array
# it respondes to all of Array's methods so we can iterate over it and do whatever we like
strains.each { |strain| p strain.name } # would print out all the strain names
strains.each do |strain| # so would this
p strain.name
end
# and we can read their attributes easily
strains.first.name # returns the name of the first strain.
strains.first.description # returns the description of the first strain.
Contributing
- Fork it ( https://github.com/patrickr/leaflyapi/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request