Class: Kelbim::DSL::EC2::LoadBalancer::Attributes
- Inherits:
-
Object
- Object
- Kelbim::DSL::EC2::LoadBalancer::Attributes
- Includes:
- Checker, TemplateHelper
- Defined in:
- lib/kelbim/dsl/attributes.rb
Instance Method Summary collapse
-
#initialize(context, load_balancer, &block) ⇒ Attributes
constructor
A new instance of Attributes.
- #method_missing(method_name, *args) ⇒ Object
- #result ⇒ Object
Methods included from TemplateHelper
Constructor Details
#initialize(context, load_balancer, &block) ⇒ Attributes
Returns a new instance of Attributes.
9 10 11 12 13 14 |
# File 'lib/kelbim/dsl/attributes.rb', line 9 def initialize(context, load_balancer, &block) @error_identifier = "LoadBalancer `#{load_balancer}`" @context = context.dup @result = {} instance_eval(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/kelbim/dsl/attributes.rb', line 21 def method_missing(method_name, *args) if args.length == 1 value = args.first call_once(method_name) expected_type(value, Hash, Array) @result[method_name] = value else super end end |
Instance Method Details
#result ⇒ Object
16 17 18 19 |
# File 'lib/kelbim/dsl/attributes.rb', line 16 def result required(:cross_zone_load_balancing, @result[:cross_zone_load_balancing]) @result end |