Class: Kelbim::DSL::EC2::LoadBalancer::Listeners::Listener
- Inherits:
-
Object
- Object
- Kelbim::DSL::EC2::LoadBalancer::Listeners::Listener
- Includes:
- Checker
- Defined in:
- lib/kelbim/dsl/listener.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(load_balancer, protocol_prots, &block) ⇒ Listener
constructor
A new instance of Listener.
- #policies(value) ⇒ Object
- #server_certificate(value) ⇒ Object
Constructor Details
#initialize(load_balancer, protocol_prots, &block) ⇒ Listener
Returns a new instance of Listener.
13 14 15 16 17 18 19 20 21 |
# File 'lib/kelbim/dsl/listener.rb', line 13 def initialize(load_balancer, protocol_prots, &block) @error_identifier = "LoadBalancer `#{load_balancer}`: #{protocol_prots}" @result = OpenStruct.new({ :policies => [] }) instance_eval(&block) end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
23 24 25 |
# File 'lib/kelbim/dsl/listener.rb', line 23 def result @result end |
Instance Method Details
#policies(value) ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/kelbim/dsl/listener.rb', line 30 def policies(value) call_once(:policies) expected_type(value, Hash) unless value.kind_of?(Hash) raise "LoadBalancer `#{@load_balancer}`: #{@protocol_prots}: Invalid policies: #{value}" end value = value.map do |policy, name_or_attrs| expected_type(name_or_attrs, String, Hash) policy = PolicyTypes.symbol_to_string(policy) [policy, name_or_attrs] end @result.policies = value end |
#server_certificate(value) ⇒ Object
25 26 27 28 |
# File 'lib/kelbim/dsl/listener.rb', line 25 def server_certificate(value) call_once(:server_certificate) @result.server_certificate = value end |