Skip to content

3to8-decoder/restmapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Use this to map around. Quick example:

require "lib/restmapper"

class Google
  include RESTMapper
  base_url 'www.google.nl'

  get :search,"/search?q=:query"  
end

puts Google.search(:query => "qwfghdf")

We can also specify a block:

get :search,"/search?q=:query" do |result|
  parse_method result
end

Unlimited parameters

  get :search,"/search?q=:query&hl=:country" do |result|
    parse_method result
  end

puts Google.search(:query => "Ruby",:country => 'en')

You can also specify defaults:

get :search,"/search?q=:query&hl=:country",:country=> 'en' do |result|
  parse_method result
end

puts Google.search(:query => "Ruby")

Please understand that this is still a work in progress. Post, Update en Delete will be added in time. If you cannot wait, just fork and add it yourself.

About

Map REST Calls to a class to easily consume web services.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages