Class: AwsInventory::Presenter

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_inventory/presenter.rb

Defined Under Namespace

Classes: Base, Json, Tab, Table

Instance Method Summary collapse

Constructor Details

#initialize(options, data) ⇒ Presenter

Returns a new instance of Presenter.



7
8
9
10
# File 'lib/aws_inventory/presenter.rb', line 7

def initialize(options, data)
  @options = options
  @data = data
end

Instance Method Details

#displayObject



12
13
14
15
16
# File 'lib/aws_inventory/presenter.rb', line 12

def display
  presenter_class = "AwsInventory::Presenter::#{format.classify}".constantize
  presenter = presenter_class.new(@options, @data)
  presenter.display
end

#formatObject

Formats: tabs, markdown



19
20
21
# File 'lib/aws_inventory/presenter.rb', line 19

def format
  ENV['AWS_INVENTORY_FORMAT'] || "table"
end