Class: Stax::Examples::VpcGenerator

Inherits:
Generators::Base
  • Object
show all
Defined in:
lib/generators/vpc/vpc_generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cidr_blockObject

Returns the value of attribute cidr_block.



7
8
9
# File 'lib/generators/vpc/vpc_generator.rb', line 7

def cidr_block
  @cidr_block
end

#subnetsObject

Returns the value of attribute subnets.



7
8
9
# File 'lib/generators/vpc/vpc_generator.rb', line 7

def subnets
  @subnets
end

Instance Method Details

#add_to_staxfileObject



17
18
19
# File 'lib/generators/vpc/vpc_generator.rb', line 17

def add_to_staxfile
  append_to_file 'Staxfile', "stack :#{options[:stack]}"
end

#create_vpc_filesObject



11
12
13
14
15
# File 'lib/generators/vpc/vpc_generator.rb', line 11

def create_vpc_files
  @cidr_block = ask('cidr block for vpc?', default: '10.0.0.0/16')
  @subnets = ask('number of subnets to create?', default: '3')
  directory '.', 'cf'
end