Sha256: 062bca9abca214a9c02b9a93a3c1dd16afa6b6e32869c5928352524fa299c2fb

Contents?: true

Size: 470 Bytes

Versions: 3

Compression:

Stored size: 470 Bytes

Contents

class Inventory::Presenter
  autoload :Base, "inventory/presenters/base"
  autoload :Tab, "inventory/presenters/tab"
  autoload :Table, "inventory/presenters/table"

  def initialize(data)
    @data = data
  end

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

  # Formats: tabs, markdown
  def format
    ENV['AWS_INVENTORY_FORMAT'] || "table"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
aws-inventory-0.3.0 lib/inventory/presenter.rb
aws-inventory-0.2.1 lib/inventory/presenter.rb
aws-inventory-0.2.0 lib/inventory/presenter.rb