lib/inforouter.rb in inforouter-0.1.0 vs lib/inforouter.rb in inforouter-0.2.0
- old
+ new
@@ -1,18 +1,37 @@
require 'savon'
+require 'i18n'
+require 'active_support'
+require 'active_support/core_ext'
+require 'inforouter/version'
+require 'inforouter/errors'
+require 'inforouter/responses'
+require 'inforouter/record'
require 'inforouter/access_list'
-require 'inforouter/folder_rule'
-require 'inforouter/client'
+require 'inforouter/access_list_domain_members_item'
+require 'inforouter/access_list_user_group_item'
+require 'inforouter/access_list_user_item'
+require 'inforouter/document'
+require 'inforouter/folder'
+require 'inforouter/rights'
+require 'inforouter/rule_item'
+require 'inforouter/rules'
+require 'inforouter/user'
+require 'inforouter/users'
require 'inforouter/configuration'
-require 'inforouter/errors'
-require 'inforouter/version'
+require 'inforouter/client'
+I18n.load_path << File.join(File.dirname(__FILE__), 'config', 'locales', 'en.yml')
+
module Inforouter
class << self
attr_accessor :configuration
+ # infoRouter API version.
+ API_VERSION = '8.0'
+
# Returns true if the gem has been configured.
def configured?
!!configured
end
@@ -25,18 +44,18 @@
def reset!
self.configuration = nil
@client = nil
end
- def client
+ def client(options = {})
check_configuration!
- @client ||= Inforouter::Client.new
+ @client ||= Inforouter::Client.new(options)
end
private
def check_configuration!
fail Inforouter::Errors::MissingConfig.new unless self.configuration
- self.configuration_check!
+ self.configuration.check!
end
end
end