Sha256: 6eea8d557e4c4e494d90098c6966c6a1fc54e177efd2e498f2ffc6c5f80bbb1f

Contents?: true

Size: 787 Bytes

Versions: 10

Compression:

Stored size: 787 Bytes

Contents

$:.unshift(File.dirname(__FILE__)) unless $:.include?(File.dirname(__FILE__))

require 'restfulie/version'
require 'restfulie/common'
require 'restfulie/client'
require 'restfulie/server'

# Shortcut to RestfulieDsl
module Restfulie

  # creates a new entry point for executing requests
  def self.at(uri)
    Restfulie.use.at(uri)
  end

  def self.using(&block)
    RestfulieUsing.new.instance_eval(&block)
  end
  
  def self.use(&block)
    if block_given?
      Restfulie::Client::Dsl.new.instance_eval(&block)
    else
      Restfulie::Client::Dsl.new
    end
  end
  
end

class RestfulieUsing
  def method_missing(sym, *args)
    @current = "Restfulie::Client::HTTP::#{sym.to_s.classify}".constantize.new(@current || Restfulie::Client::HTTP::RequestAdapter.new, *args)
  end
end

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
restfulie-nosqlite-1.0.4 lib/restfulie.rb
restfulie-1.1.1 lib/restfulie.rb
restfulie-1.1.0 lib/restfulie.rb
restfulie-nosqlite-1.0.3 lib/restfulie.rb
restfulie-1.0.3 lib/restfulie.rb
restfulie-1.0.0 lib/restfulie.rb
restfulie-1.0.0.beta5 lib/restfulie.rb
restfulie-1.0.0.beta4 lib/restfulie.rb
restfulie-1.0.0.beta1 lib/restfulie.rb
restfulie-0.1.0.beta1 lib/restfulie.rb