Class: Lamby::Configuration
- Inherits:
-
Object
- Object
- Lamby::Configuration
- Defined in:
- lib/lamby/config.rb
Instance Method Summary collapse
- #cold_start_metrics=(bool) ⇒ Object
- #cold_start_metrics? ⇒ Boolean
- #event_bridge_handler ⇒ Object
- #event_bridge_handler=(func) ⇒ Object
- #handled_proc ⇒ Object
- #handled_proc=(proc) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #initialize_defaults ⇒ Object
- #metrics_app_name ⇒ Object
- #metrics_app_name=(name) ⇒ Object
- #rack_app ⇒ Object
- #rack_app=(app) ⇒ Object
- #reconfigure {|_self| ... } ⇒ Object
- #runner_patterns ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
23 24 25 |
# File 'lib/lamby/config.rb', line 23 def initialize initialize_defaults end |
Instance Method Details
#cold_start_metrics=(bool) ⇒ Object
73 74 75 |
# File 'lib/lamby/config.rb', line 73 def cold_start_metrics=(bool) @cold_start_metrics = bool end |
#cold_start_metrics? ⇒ Boolean
69 70 71 |
# File 'lib/lamby/config.rb', line 69 def cold_start_metrics? @cold_start_metrics end |
#event_bridge_handler ⇒ Object
49 50 51 |
# File 'lib/lamby/config.rb', line 49 def event_bridge_handler @event_bridge_handler end |
#event_bridge_handler=(func) ⇒ Object
53 54 55 |
# File 'lib/lamby/config.rb', line 53 def event_bridge_handler=(func) @event_bridge_handler = func end |
#handled_proc ⇒ Object
61 62 63 |
# File 'lib/lamby/config.rb', line 61 def handled_proc @handled_proc ||= Proc.new { |_event, _context| } end |
#handled_proc=(proc) ⇒ Object
65 66 67 |
# File 'lib/lamby/config.rb', line 65 def handled_proc=(proc) @handled_proc = proc end |
#initialize_defaults ⇒ Object
42 43 44 45 46 47 |
# File 'lib/lamby/config.rb', line 42 def initialize_defaults @rack_app = nil @cold_start_metrics = false @metrics_app_name = nil @event_bridge_handler = lambda { |event, context| puts(event) } end |
#metrics_app_name ⇒ Object
77 78 79 |
# File 'lib/lamby/config.rb', line 77 def metrics_app_name @metrics_app_name end |
#metrics_app_name=(name) ⇒ Object
81 82 83 |
# File 'lib/lamby/config.rb', line 81 def metrics_app_name=(name) @metrics_app_name = name end |
#rack_app ⇒ Object
34 35 36 |
# File 'lib/lamby/config.rb', line 34 def rack_app @rack_app ||= ::Rack::Builder.new { run ::Rails.application }.to_app end |
#rack_app=(app) ⇒ Object
38 39 40 |
# File 'lib/lamby/config.rb', line 38 def rack_app=(app) @rack_app = app end |
#reconfigure {|_self| ... } ⇒ Object
27 28 29 30 31 32 |
# File 'lib/lamby/config.rb', line 27 def reconfigure instance_variables.each { |var| instance_variable_set var, nil } initialize_defaults yield(self) if block_given? self end |
#runner_patterns ⇒ Object
57 58 59 |
# File 'lib/lamby/config.rb', line 57 def runner_patterns LambdaConsole::Run::PATTERNS end |