Skip to content

XD6Code/tincan-gem

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gem Version Build Status Code Climate Score Code Climate Coverage License

Installation

From Ruby Gems

gem install tincan-api

From Github

git clone https://github.com/XD6Code/tincan-gem.git
cd tincan-gem
gem build tincan-api.gemspec
gem install tincan-api-*.gem

Usage

Demo queries can be found on the TinCan Storage API demo page, however in the ruby gem they can be inputted as a Hash or JSON.

Example Query (Hash): {:query => {:key => "value"}, :options => {:count => true}}

Example Query (JSON): '{"key":"value"}'

require "tincan"

demo = TinCan.new("APP_ID", "APP_KEY", "APP_NAME")

demo.validate      #=> Returns True or an Error
demo.insert(query) #=> Returns true if successful
demo.find(query)   #=> Returns data if successful
demo.update(query) #=> Returns true if successful
demo.remove(query) #=> returns true if successful

Testing

Testing is done with RSpec for now.

gem install rspec
cd /path/to/downloaded/repo
rspec spec

To get a better output of what it's doing (Get told what it's doing rather than dots):

rspec spec --format documentation