Class: AwsInventory::Presenter
- Inherits:
-
Object
- Object
- AwsInventory::Presenter
- Defined in:
- lib/aws_inventory/presenter.rb
Defined Under Namespace
Classes: Base, Json, Tab, Table
Instance Method Summary collapse
- #display ⇒ Object
-
#format ⇒ Object
Formats: tabs, markdown.
-
#initialize(options, data) ⇒ Presenter
constructor
A new instance of Presenter.
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(, data) = @data = data end |
Instance Method Details
#display ⇒ Object
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(, @data) presenter.display end |
#format ⇒ Object
Formats: tabs, markdown
19 20 21 |
# File 'lib/aws_inventory/presenter.rb', line 19 def format ENV['AWS_INVENTORY_FORMAT'] || "table" end |