Project

leaflyapi

0.0
No commit activity in last 3 years
No release in over 3 years
get strains and strain details from leafly.com
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.5.3
>= 0
>= 0
>= 0
>= 0

Runtime

>= 0
 Project Readme

Leaflyapi

build status Coverage Status Gem Version

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

  1. Fork it ( https://github.com/patrickr/leaflyapi/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request