Class: Kelbim::DSL::EC2::LoadBalancer::HealthCheck
- Inherits:
-
Object
- Object
- Kelbim::DSL::EC2::LoadBalancer::HealthCheck
- Includes:
- Checker
- Defined in:
- lib/kelbim/dsl/health-check.rb
Instance Method Summary collapse
- #healthy_threshold(value) ⇒ Object
-
#initialize(load_balancer, &block) ⇒ HealthCheck
constructor
A new instance of HealthCheck.
- #interval(value) ⇒ Object
- #result ⇒ Object
- #target(value) ⇒ Object
- #timeout(value) ⇒ Object
- #unhealthy_threshold(value) ⇒ Object
Constructor Details
#initialize(load_balancer, &block) ⇒ HealthCheck
Returns a new instance of HealthCheck.
11 12 13 14 15 |
# File 'lib/kelbim/dsl/health-check.rb', line 11 def initialize(load_balancer, &block) @error_identifier = "LoadBalancer `#{load_balancer}`" @result = {} instance_eval(&block) end |
Instance Method Details
#healthy_threshold(value) ⇒ Object
42 43 44 45 46 |
# File 'lib/kelbim/dsl/health-check.rb', line 42 def healthy_threshold(value) call_once(:healthy_threshold) expected_type(value, Integer) @result[:healthy_threshold] = value end |
#interval(value) ⇒ Object
36 37 38 39 40 |
# File 'lib/kelbim/dsl/health-check.rb', line 36 def interval(value) call_once(:interval) expected_type(value, Integer) @result[:interval] = value end |
#result ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/kelbim/dsl/health-check.rb', line 17 def result [:target, :timeout, :interval, :healthy_threshold, :unhealthy_threshold].each do |name| required(name, @result[name]) end @result end |
#target(value) ⇒ Object
25 26 27 28 |
# File 'lib/kelbim/dsl/health-check.rb', line 25 def target(value) call_once(:target) @result[:target] = value end |
#timeout(value) ⇒ Object
30 31 32 33 34 |
# File 'lib/kelbim/dsl/health-check.rb', line 30 def timeout(value) call_once(:timeout) expected_type(value, Integer) @result[:timeout] = value end |
#unhealthy_threshold(value) ⇒ Object
48 49 50 51 52 |
# File 'lib/kelbim/dsl/health-check.rb', line 48 def unhealthy_threshold(value) call_once(:unhealthy_threshold) expected_type(value, Integer) @result[:unhealthy_threshold] = value end |