Class: Inventory::Presenter
- Inherits:
-
Object
- Object
- Inventory::Presenter
- Defined in:
- lib/inventory/presenter.rb
Defined Under Namespace
Instance Method Summary collapse
- #display ⇒ Object
-
#format ⇒ Object
Formats: tabs, markdown.
-
#initialize(data) ⇒ Presenter
constructor
A new instance of Presenter.
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
#display ⇒ Object
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 |
#format ⇒ Object
Formats: tabs, markdown
17 18 19 |
# File 'lib/inventory/presenter.rb', line 17 def format ENV['AWS_INVENTORY_FORMAT'] || "table" end |