Module: Stackit::Mixin::AvailabilityZone
- Included in:
- Tier
- Defined in:
- lib/stackit/mixin/availability_zone.rb
Instance Attribute Summary collapse
-
#az_syms ⇒ Object
Returns the value of attribute az_syms.
Instance Method Summary collapse
- #availability_zones ⇒ Object
- #random_az ⇒ Object
- #random_az_hash ⇒ Object
- #selected_az ⇒ Object
- #selected_az_sym ⇒ Object
Instance Attribute Details
#az_syms ⇒ Object
Returns the value of attribute az_syms.
3 4 5 |
# File 'lib/stackit/mixin/availability_zone.rb', line 3 def az_syms @az_syms end |
Instance Method Details
#availability_zones ⇒ Object
11 12 13 |
# File 'lib/stackit/mixin/availability_zone.rb', line 11 def availability_zones resolve_parameters(az_syms) end |
#random_az ⇒ Object
23 24 25 |
# File 'lib/stackit/mixin/availability_zone.rb', line 23 def random_az resolve_parameters(az_syms).split(',').sample end |
#random_az_hash ⇒ Object
27 28 29 30 31 32 |
# File 'lib/stackit/mixin/availability_zone.rb', line 27 def random_az_hash sampled_az_sym = az_syms.sample { sampled_az_sym => resolve_parameter(sampled_az_sym) } end |
#selected_az ⇒ Object
19 20 21 |
# File 'lib/stackit/mixin/availability_zone.rb', line 19 def selected_az selected_az_hash.values[0] end |
#selected_az_sym ⇒ Object
15 16 17 |
# File 'lib/stackit/mixin/availability_zone.rb', line 15 def selected_az_sym selected_az_hash.keys[0].to_sym end |