Class: Inventory::Presenter

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

Defined Under Namespace

Classes: Base, Tab, Table

Instance Method Summary collapse

Constructor Details

#initialize(data) ⇒ Presenter

Returns a new instance of Presenter.



6
7
8
# File 'lib/inventory/presenter.rb', line 6

def initialize(data)
  @data = data
end

Instance Method Details

#displayObject



10
11
12
13
14
# File 'lib/inventory/presenter.rb', line 10

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

#formatObject

Formats: tabs, markdown



17
18
19
# File 'lib/inventory/presenter.rb', line 17

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