Class: Vaws::Aws::VpcDescriber
- Defined in:
- lib/vaws/aws/vpc_describer.rb
Instance Attribute Summary collapse
-
#term_table ⇒ Object
readonly
Returns the value of attribute term_table.
Instance Method Summary collapse
-
#initialize ⇒ VpcDescriber
constructor
A new instance of VpcDescriber.
- #set_basic_info ⇒ Object
Constructor Details
#initialize ⇒ VpcDescriber
Returns a new instance of VpcDescriber.
9 10 11 12 |
# File 'lib/vaws/aws/vpc_describer.rb', line 9 def initialize @vpc_client = ::Aws::EC2::Client.new @term_table = '' end |
Instance Attribute Details
#term_table ⇒ Object (readonly)
Returns the value of attribute term_table.
7 8 9 |
# File 'lib/vaws/aws/vpc_describer.rb', line 7 def term_table @term_table end |
Instance Method Details
#set_basic_info ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/vaws/aws/vpc_describer.rb', line 14 def set_basic_info rows = [] vpcs = @vpc_client.describe_vpcs vpcs.vpcs.each do |vpc| cidr = vpc.cidr_block vpc_id = vpc.vpc_id = '' vpc..each_with_index do |tag, index| << "#{tag.value}, " = .gsub(/, $/, '') if index == vpc..size - 1 end rows << [vpc_id, cidr, ] end @term_table = Terminal::Table.new :headings => ['VpcId', 'Cidr', 'Tags'], :rows => rows.sort end |