whitehouse 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/whitehouse.rb ADDED
@@ -0,0 +1,33 @@
1
+ require "whitehouse/client"
2
+ require "whitehouse/default"
3
+ require "whitehouse/order"
4
+
5
+ # Ruby toolkit for the WHCC API
6
+ module Whitehouse
7
+ class << self
8
+ include Whitehouse::Configurable
9
+
10
+ # API client based on configured options {Configurable}
11
+ #
12
+ # @return [Whitehouse::Client] API wrapper
13
+ def client
14
+ @client = Whitehouse::Client.new(options) unless defined?(@client) && @client.same_options?(options)
15
+ @client
16
+ end
17
+
18
+ # @private
19
+ def respond_to_missing?(method_name, include_private=false); client.respond_to?(method_name, include_private); end if RUBY_VERSION >= "1.9"
20
+ # @private
21
+ def respond_to?(method_name, include_private=false); client.respond_to?(method_name, include_private) || super; end if RUBY_VERSION < "1.9"
22
+
23
+ private
24
+
25
+ def method_missing(method_name, *args, &block)
26
+ return super unless client.respond_to?(method_name)
27
+ client.send(method_name, *args, &block)
28
+ end
29
+
30
+ end
31
+ end
32
+
33
+ Whitehouse.setup