Module: Jets::Lambda::Dsl

Extended by:
ActiveSupport::Concern
Included in:
Functions
Defined in:
lib/jets/lambda/dsl.rb

Overview

Other dsl that rely on this must implement

default_associated_resource_definition

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.add_custom_resource_extensions(base) ⇒ Object

end of included



308
309
310
311
312
313
314
315
316
317
318
319
320
321
# File 'lib/jets/lambda/dsl.rb', line 308

def self.add_custom_resource_extensions(base)
  base_path = "#{Jets.root}/app/extensions"
  unless ActiveSupport::Dependencies.autoload_paths.include?(base_path)
    ActiveSupport::Dependencies.autoload_paths += [base_path]
  end

  Dir.glob("#{base_path}/**/*.rb").each do |path|
    next unless File.file?(path)

    class_name = path.sub("#{base_path}/", '').sub(/\.rb/,'').classify
    klass = class_name.constantize # autoload
    base.extend(klass)
  end
end

.included(base) ⇒ Object



323
324
325
# File 'lib/jets/lambda/dsl.rb', line 323

def self.included(base)
  add_custom_resource_extensions(base)
end

Instance Method Details

#lambda_functionsObject



10
11
12
# File 'lib/jets/lambda/dsl.rb', line 10

def lambda_functions
  self.class.lambda_functions
end