Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
lib
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

README.md

ForwardSlash

An HTTP client with REST literals

Description

ForwardSlash makes REST a first-class citizen of the Ruby programming language. Rather than forcing developers to write code that makes calls to URLs over HTTP, ForwardSlash lets you drop the URL right in your code - no more worrying about what HTTP is. This blog post explains it best.

Getting started

Install the gem:

gem install forward-slash

Require the module:

require 'forward_slash'

Then include the ForwardSlash module in a class you want to make HTTP calls from, and you're good to go! Here's a runnable example (taken from the examples folder):

#!/usr/bin/env ruby

$LOAD_PATH.unshift 'lib'
require "bundler"
Bundler.require

class CurrentIp
  include ForwardSlash

  def self.print
    http://ifconfig.me/ip
    puts result
  end
end

CurrentIp.print

Limitations

Anything that isn't valid Ruby syntax is unsupported, including:

  • Query strings
  • Trailing slashes on URLs

Compatibility

I've tested it on Ruby 2.2.4. It might work on other versions.

Should I use this?

#yeauxleaux

I regret nothing

About

An HTTP client with REST literals

Resources

License

Languages

You can’t perform that action at this time.