Module: Legion::Extensions::Helpers::Lex

Includes:
Cache, Core, Data, Logger, Secret, Task, Transport, JSON::Helper
Included in:
Absorbers::Base, Actors::Base, Core, Legion::Extensions::Hooks::Base
Defined in:
lib/legion/extensions/helpers/lex.rb

Constant Summary

Constants included from Base

Base::NAMESPACE_BOUNDARIES

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base

#actor_class, #actor_const, #actor_name, #amqp_prefix, #calling_class, #calling_class_array, #from_json, #full_path, #lex_class, #lex_const, #lex_name, #lex_slug, #log_tag, #normalize, #runner_class, #runner_const, #runner_name, #segments, #settings_path, #table_prefix, #to_dotted_hash

Methods included from Task

#generate_task_id, #generate_task_log, #task_update

Methods included from Logger

#handle_runner_exception

Methods included from Secret

reset_identity!, resolve_identity!, #secret

Methods included from Core

#find_setting

Class Method Details

.included(base) ⇒ Object



36
37
38
39
40
41
42
43
44
# File 'lib/legion/extensions/helpers/lex.rb', line 36

def self.included(base)
  if base.instance_of?(Class)
    base.send :extend, Legion::Extensions::Helpers::Core
    base.send :extend, Legion::Extensions::Helpers::Logger
    base.send :extend, Legion::Extensions::Helpers::Cache
    base.send :extend, Legion::Extensions::Helpers::Transport
  end
  base.extend base if base.instance_of?(Module)
end

Instance Method Details

#default_settingsObject



46
47
48
# File 'lib/legion/extensions/helpers/lex.rb', line 46

def default_settings
  { logger: { level: 'info' }, workers: 1, runners: {}, functions: {} }
end

#runner_desc(desc) ⇒ Object



30
31
32
33
34
# File 'lib/legion/extensions/helpers/lex.rb', line 30

def runner_desc(desc)
  settings[:runners] = {} if settings[:runners].nil?
  settings[:runners][actor_name.to_sym] = {} if settings[:runners][actor_name.to_sym].nil?
  settings[:runners][actor_name.to_sym][:desc] = desc
end