Class: Ec2::Blackout::Options
- Inherits:
-
Object
- Object
- Ec2::Blackout::Options
- Defined in:
- lib/ec2-blackout/options.rb
Constant Summary collapse
- DEFAULT_REGIONS =
['us-east-1', 'us-west-1', 'us-west-2', 'eu-west-1', 'ap-southeast-1', 'ap-southeast-2', 'ap-northeast-1', 'sa-east-1']
Instance Method Summary collapse
- #dry_run ⇒ Object
- #exclude_tags ⇒ Object
- #force ⇒ Object
- #include_tags ⇒ Object
-
#initialize(options = {}) ⇒ Options
constructor
A new instance of Options.
- #matches_exclude_tags?(tags) ⇒ Boolean
- #matches_include_tags?(tags) ⇒ Boolean
- #regions ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
6 7 8 9 |
# File 'lib/ec2-blackout/options.rb', line 6 def initialize( = {}) @options = @options[:regions] = DEFAULT_REGIONS unless @options[:regions] end |
Instance Method Details
#dry_run ⇒ Object
33 34 35 |
# File 'lib/ec2-blackout/options.rb', line 33 def dry_run @options[:dry_run] end |
#exclude_tags ⇒ Object
15 16 17 |
# File 'lib/ec2-blackout/options.rb', line 15 def @exclude_tags ||= key_value_hash(@options[:exclude_by_tag]) end |
#force ⇒ Object
37 38 39 |
# File 'lib/ec2-blackout/options.rb', line 37 def force @options[:force] end |
#include_tags ⇒ Object
11 12 13 |
# File 'lib/ec2-blackout/options.rb', line 11 def @include_tags ||= key_value_hash(@options[:include_by_tag]) end |
#matches_exclude_tags?(tags) ⇒ Boolean
24 25 26 27 |
# File 'lib/ec2-blackout/options.rb', line 24 def () return false unless (, ) end |
#matches_include_tags?(tags) ⇒ Boolean
19 20 21 22 |
# File 'lib/ec2-blackout/options.rb', line 19 def () return true unless (, ) end |
#regions ⇒ Object
29 30 31 |
# File 'lib/ec2-blackout/options.rb', line 29 def regions @options[:regions] end |