Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Adds support to uri-templates in the dsl restfolia
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
.travis.yml
Gemfile
Gemfile.lock
LICENSE.txt
README.md
Rakefile
restfolia-uritemplate.gemspec

README.md

restfolia-uritemplate Build Status

Adds support to uri-templates in the dsl restfolia with the help of gem uri_template

See more about uri-template in RFC 6570

Example of use

// GET http://local.service.net/id/1
{
  "value": 10,
  "name": "Test",
  "query": null,
  "tested": false,
  "links": [
    {
      "href": "http://local.service.net/{term:1}/{term}",
      "rel": "search",
      "type": "application/json"
    },
    {
      "href": "http://local.service.net/foo{?query,number}",
      "rel": "another_search",
      "type": "application/json"
    },
    {
      "href": "http://local.service.net/resource/index",
      "rel": "self",
      "type": "application/json"
    }
  ]
}
# getting a resource
resource = Restfolia.at('http://local.service.net/id/1').get

# example of hypermedia navigation with uri-template
new_resource_ = resource.link('search').expansion(:term => "dog")
search = new_resource.get  # => GET to url http://local.service.net/d/dog

Copyright

Copyright (c) 2012 Nadilson. See LICENSE.txt for further details.

Something went wrong with that request. Please try again.