Module: LWS
- Defined in:
- lib/lws.rb,
lib/lws/version.rb
Overview
Main LeftClick web services module
This module is the main namespace for the web service/application libraries that are represented by submodules. The LWS module is used to load, set up and configure the supported application/web service libraries.
Defined Under Namespace
Modules: Auth, Generic, Maps, Presence Classes: Config
Constant Summary collapse
- SUPPORTED_APPS =
The list of supported apps (web service libraries) loaded by setup.
[:generic, :auth, :maps, :presence]
- VERSION =
Note:
This is not the API version!
The LWS library version.
'0.2.0'
Class Method Summary collapse
-
.load_app_modules ⇒ Array<Symbol>
(Re)loads the app modules (usually done by LWS.setup).
-
.setup {|config| ... } ⇒ LWS
Sets up the application API libraries using the provided configuration (see Config).
Instance Method Summary collapse
-
#config ⇒ Config
The API configuration for the web services.
Class Method Details
.load_app_modules ⇒ Array<Symbol>
(Re)loads the app modules (usually done by setup).
187 188 189 190 191 192 |
# File 'lib/lws.rb', line 187 def self.load_app_modules app_module_path = File.dirname(__FILE__) SUPPORTED_APPS.each do |app| load "#{app_module_path}/lws/#{app}.rb" end end |
.setup {|config| ... } ⇒ LWS
Sets up the application API libraries using the provided configuration (see Config).
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 |
# File 'lib/lws.rb', line 140 def self.setup(&block) @@config = Config.new yield @@config if config.api_token.blank? and config.api_token_middleware.blank? raise "API token or API token middleware is required" end # Override the environment if needed if ENV["LC_LWS_ENV"].present? @@config.environment = ENV["LC_LWS_ENV"].to_sym end load_app_modules return self end |
Instance Method Details
#config ⇒ Config
Returns the API configuration for the web services.
82 |
# File 'lib/lws.rb', line 82 mattr_reader :config |