Class: Lamby::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/lamby/config.rb

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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

Returns:

  • (Boolean)


69
70
71
# File 'lib/lamby/config.rb', line 69

def cold_start_metrics?
  @cold_start_metrics
end

#event_bridge_handlerObject



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_procObject



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_defaultsObject



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_nameObject



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_appObject



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

Yields:

  • (_self)

Yield Parameters:



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_patternsObject



57
58
59
# File 'lib/lamby/config.rb', line 57

def runner_patterns
  LambdaConsole::Run::PATTERNS
end