lib/capgun.rb in capgun-0.0.1 vs lib/capgun.rb in capgun-0.0.3

- old
+ new

@@ -1,3 +1,31 @@ module Capgun - require 'capgun/version' + + require 'capgun/config' + require 'capgun/client' + + extend Config + + class << self + + extend Config + + # Alias for Capgun::Client.new + # + # @param [Hash] options options for the Capgun::Client + # @return [Capgun::Client] + def new(options={}) + Capgun::Client.new(options) + end + + # Delegate methods to Capgun::Client + def method_missing(method, *args, &block) + return super unless new.respond_to?(method) + new.send(method, *args, &block) + end + + # Corollary of #method_missing delegated to Capgun::Client + def respond_to?(method, include_private=false) + new.respond_to?(method, include_private) || super(method, include_private) + end + end end