Module: LWS::Generic

Included in:
Auth, CorporateWebsite, DigitalSignage, Maps, Presence, Resource, Ticket
Defined in:
lib/lws/apps/generic.rb

Overview

The generic app module

This module contains classes that are present in all applications.

Defined Under Namespace

Classes: Configuration, Model, Storage

Class Method Summary collapse

Class Method Details

.included(app_mod) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/lws/apps/generic.rb', line 18

def self.included(app_mod)
  app_mod.module_eval do |mod|
    # Set up the API using the configured or default endpoint for the current
    # environment.
    endpoints = mod.const_get(:ENDPOINT)
    app_name = mod.name.demodulize.underscore.to_sym
    @api = LWS.setup_api(LWS.config.endpoints[app_name] ||
                         endpoints[LWS.config.environment])

    def self.api
      @api
    end

    def self.endpoint
      @api.url_prefix.to_s
    end
  end
end