Sha256: 4a98f04050bbd545bffda9c406f5ebe9a52421284f44369ddf712a7d4a6bda24

Contents?: true

Size: 557 Bytes

Versions: 2

Compression:

Stored size: 557 Bytes

Contents

class Lono::CLI
  class List < Base
    attr_reader :options
    def initialize(options={})
      @options = options
    end

    def run
      list_type("blueprints") if show?("blueprint")
      list_type("configsets") if show?("configset")
      list_type("extensions") if show?("extension")
    end

  private
    def list_type(type)
      lookup.list(type)
    end

    def lookup
      Lono::Lookup.new
    end
    memoize :lookup

    def show?(type)
      @options[:type] == type || @options[:type].nil? || @options[:type] == "all"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lono-8.0.0.pre.rc2 lib/lono/cli/list.rb
lono-8.0.0.pre.rc1 lib/lono/cli/list.rb