Class: Lamby::Configuration
- Inherits:
-
Object
- Object
- Lamby::Configuration
- Defined in:
- lib/lamby/config.rb
Instance Method Summary collapse
- #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
- #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
#event_bridge_handler ⇒ Object
47 48 49 |
# File 'lib/lamby/config.rb', line 47 def event_bridge_handler @event_bridge_handler end |
#event_bridge_handler=(func) ⇒ Object
51 52 53 |
# File 'lib/lamby/config.rb', line 51 def event_bridge_handler=(func) @event_bridge_handler = func end |
#handled_proc ⇒ Object
59 60 61 |
# File 'lib/lamby/config.rb', line 59 def handled_proc @handled_proc ||= Proc.new { |_event, _context| } end |
#handled_proc=(proc) ⇒ Object
63 64 65 |
# File 'lib/lamby/config.rb', line 63 def handled_proc=(proc) @handled_proc = proc end |
#initialize_defaults ⇒ Object
42 43 44 45 |
# File 'lib/lamby/config.rb', line 42 def initialize_defaults @rack_app = nil @event_bridge_handler = lambda { |event, context| puts(event) } 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 |