Project

tastyrb

0.0
No commit activity in last 3 years
No release in over 3 years
Generic client for self-describing APIs built with django-tastypie.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.2.0
>= 0.5.2
>= 1.1.3
 Project Readme

Tastyrb

A thin wrapper for self-describing tastypie APIs

Parameters:

  • api_key: Key to be passed to the server in GET array
  • api_key_param: String name of the GET param to send the key as
  • base_uri: The self-describing root of the api. When you change this, Tastyrb will redefine the methods it responds to.
  • jsonp_callback: Not very useful, but there if you just want to return a raw jsonp string back to the browser
  • word_separator: The character to use to convert paths to method calls. ex: '_' would convert '/posts/latest/comments/' into posts_latest_comments()

Usage:

api = Tastyrb::Client.new(base_uri='http://readthedocs.org/api/v1/')
#=> #<Tastyrb::Client:0x007fa73a114c78 @resources=[:build, :file, :project, :user, :version], @api_key=nil, @api_key_param="api_key", @jsonp_callback=nil, @word_separator="_", @base_uri="http://readthedocs.org/api/v1/">
api.file(:limit => 1)
#=> [<#Tastyrb::Response absolute_url="/docs/django-instant-model/en/latest/index.html" ...>]