Class: Liveness::Config
- Inherits:
-
Object
- Object
- Liveness::Config
- Defined in:
- lib/liveness/config.rb
Overview
Config of liveness
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#add(name, **options, &block) ⇒ Object
Add dependency config.
- #initialize(container: Liveness.container, &block) ⇒ Liveness::Config constructor
Constructor Details
#initialize(container: Liveness.container, &block) ⇒ Liveness::Config
17 18 19 20 21 22 23 |
# File 'lib/liveness/config.rb', line 17 def initialize(container: Liveness.container, &block) @container = container @dependencies = [] @ip_whitelist = [] instance_exec(self, &block) if defined?(yield) end |
Instance Attribute Details
#dependencies ⇒ Object (readonly)
9 10 11 |
# File 'lib/liveness/config.rb', line 9 def dependencies @dependencies end |
#ip_whitelist ⇒ Object
12 13 14 |
# File 'lib/liveness/config.rb', line 12 def ip_whitelist @ip_whitelist end |
#token ⇒ Object
12 13 14 |
# File 'lib/liveness/config.rb', line 12 def token @token end |
Instance Method Details
#add(name, **options, &block) ⇒ Object
Add dependency config
32 33 34 35 36 37 |
# File 'lib/liveness/config.rb', line 32 def add(name, **, &block) dependency = @container.create(name, **, &block) return if dependency.nil? @dependencies << dependency end |