one-m1nd / plants

Trefle API gem

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Plants

Gem to interact with the trefle API.

Install

spec.add_dependency 'plants', '~> 0'

Usage

You need an authorization token, see this.

Plants.token = 'your token here'
Plants.list_plants # ... 

If you wish to override the log:

Plants::Log.instance = logger # Your logger here

Endpoints

All methods return an instance of HTTP::Response

The HTTP timeout is by default 10 seconds, you can override this by:

Plants.timeout = 5 # new value here

Corrections

# List
Plants.list_corrections

# Find 
Plants.find_correction('correction')

Distributions

# List
Plants.list_distributions

# Find 
Plants.find_distribution('correction')

Division Classes

# List
Plants.list_division_classes

# Find 
Plants.find_division_class('class')

Division Orders

# List
Plants.list_division_orders

# Find 
Plants.find_division_order('order')

Divisions

# List
Plants.list_divisions

# Find 
Plants.find_division('division')

Families

# List
Plants.list_families

# Find 
Plants.find_family('family')

Genus

# List
Plants.list_genera

# Find 
Plants.find_genus('genus')

Kingdoms

# List
Plants.list_kingdoms

# Find 
Plants.find_kingdom('kingodm')

Plants

# List
Plants.list_plants

# Find 
Plants.find_plant('plant')

# Search
Plants.search_for_plant('plant')

# List for Genus
Plants.list_plants_for_genus('genus')

# List for Distribution Zone
Plants.list_plants_for_distribution_zone('zone')

Species

# List
Plants.list_species

# Find 
Plants.find_species('species')

# Search
Plants.search_for_species('species')

Subkingdoms

# List
Plants.list_subkingdoms

# Find 
Plants.find_subkingdom('subkingdom')

About

Trefle API gem


Languages

Language:Ruby 99.5%Language:Shell 0.5%