module Legion::Extensions::Helpers::Lex
Public Class Methods
included(base)
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 36 def self.included(base) base.send :extend, Legion::Extensions::Helpers::Core if base.instance_of?(Class) base.send :extend, Legion::Extensions::Helpers::Logger if base.instance_of?(Class) base.extend base if base.instance_of?(Module) end
Public Instance Methods
default_settings()
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 42 def default_settings { logger: { level: 'info' }, workers: 1, runners: {}, functions: {} } end
function_desc(function, desc)
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 16 def function_desc(function, desc) function_set(function, :desc, desc) end
function_example(function, example)
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 8 def function_example(function, example) function_set(function, :example, example) end
function_options(function, options)
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 12 def function_options(function, options) function_set(function, :options, options) end
function_set(function, key, value)
click to toggle source
# File lib/legion/extensions/helpers/lex.rb, line 20 def function_set(function, key, value) unless respond_to? function log.debug "function_#{key} called but function doesn't exist, f: #{function}" return nil end settings[:functions] = {} if settings[:functions].nil? settings[:functions][function] = {} if settings[:functions][function].nil? settings[:functions][function][key] = value end
runner_desc(desc)
click to toggle source
# 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