Module: Belt

Defined in:
lib/belt.rb,
lib/belt/holster.rb,
lib/belt/version.rb,
lib/belt/action_router.rb,
lib/belt/observability.rb,
lib/belt/lambda_handler.rb,
lib/belt/helpers/response.rb,
lib/belt/helpers/cors_origin.rb,
lib/belt/helpers/error_logging.rb

Defined Under Namespace

Modules: Helpers, LambdaHandler, Observability Classes: ActionNotFound, ActionRouter, AuthenticationError, Holster, RecordNotFound

Constant Summary collapse

VERSION =
'0.0.5'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.controller_pathsObject (readonly)

Returns the value of attribute controller_paths.



18
19
20
# File 'lib/belt.rb', line 18

def controller_paths
  @controller_paths
end

.holstersObject (readonly)

Returns the value of attribute holsters.



44
45
46
# File 'lib/belt/holster.rb', line 44

def holsters
  @holsters
end

Class Method Details

.all_controller_pathsObject

Collects all controller paths: app-defined + holster-provided



21
22
23
# File 'lib/belt.rb', line 21

def all_controller_paths
  controller_paths + holsters.select { |h| File.directory?(h.controllers_path) }.map(&:controllers_path)
end

.all_models_pathsObject

Collects all model paths from holsters



26
27
28
# File 'lib/belt.rb', line 26

def all_models_paths
  holsters.select { |h| File.directory?(h.models_path) }.map(&:models_path)
end

.all_routes_pathsObject

Collects all routes files from holsters



31
32
33
# File 'lib/belt.rb', line 31

def all_routes_paths
  holsters.select { |h| File.exist?(h.routes_path) }.map(&:routes_path)
end

.all_schema_pathsObject

Collects all schema files from holsters



36
37
38
# File 'lib/belt.rb', line 36

def all_schema_paths
  holsters.select { |h| File.exist?(h.schema_path) }.map(&:schema_path)
end