Class: Ec2Hosts::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/ec2_hosts/options.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Options

Returns a new instance of Options.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/ec2_hosts/options.rb', line 8

def initialize(args)
  @options = {
    vpc: nil,
    tags: nil,
    template: nil,
    ignore_missing: true,
    only_running: true,
    public: nil,
    exclude_public: false,
    file: '/etc/hosts',
    backup: nil,
    dry_run: false,
    delete: false,
    clear: false
  }
  parser.parse!(args)

  if @options[:backup].nil?
    @options[:backup] = "#{@options[:file]}.bak"
  end
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



6
7
8
# File 'lib/ec2_hosts/options.rb', line 6

def options
  @options
end