Class: Kelbim::DSL::EC2::LoadBalancer::HealthCheck

Inherits:
Object
  • Object
show all
Includes:
Checker, TemplateHelper
Defined in:
lib/kelbim/dsl/health-check.rb

Instance Method Summary collapse

Methods included from TemplateHelper

#context, #include_template

Constructor Details

#initialize(context, load_balancer, &block) ⇒ HealthCheck

Returns a new instance of HealthCheck.



9
10
11
12
13
14
# File 'lib/kelbim/dsl/health-check.rb', line 9

def initialize(context, load_balancer, &block)
  @error_identifier = "LoadBalancer `#{load_balancer}`"
  @context = context.dup
  @result = {}
  instance_eval(&block)
end

Instance Method Details

#healthy_threshold(value) ⇒ Object



41
42
43
44
45
# File 'lib/kelbim/dsl/health-check.rb', line 41

def healthy_threshold(value)
  call_once(:healthy_threshold)
  expected_type(value, Integer)
  @result[:healthy_threshold] = value
end

#interval(value) ⇒ Object



35
36
37
38
39
# File 'lib/kelbim/dsl/health-check.rb', line 35

def interval(value)
  call_once(:interval)
  expected_type(value, Integer)
  @result[:interval] = value
end

#resultObject



16
17
18
19
20
21
22
# File 'lib/kelbim/dsl/health-check.rb', line 16

def result
  [:target, :timeout, :interval, :healthy_threshold, :unhealthy_threshold].each do |name|
    required(name, @result[name])
  end

  @result
end

#target(value) ⇒ Object



24
25
26
27
# File 'lib/kelbim/dsl/health-check.rb', line 24

def target(value)
  call_once(:target)
  @result[:target] = value
end

#timeout(value) ⇒ Object



29
30
31
32
33
# File 'lib/kelbim/dsl/health-check.rb', line 29

def timeout(value)
  call_once(:timeout)
  expected_type(value, Integer)
  @result[:timeout] = value
end

#unhealthy_threshold(value) ⇒ Object



47
48
49
50
51
# File 'lib/kelbim/dsl/health-check.rb', line 47

def unhealthy_threshold(value)
  call_once(:unhealthy_threshold)
  expected_type(value, Integer)
  @result[:unhealthy_threshold] = value
end