Sha256: 1769766e72fcaf1ceee1755f4a661728855215f191ad4fa701dd28f74adc7fd9

Contents?: true

Size: 800 Bytes

Versions: 35

Compression:

Stored size: 800 Bytes

Contents

# frozen_string_literal: true

require 'eac_cli/core_ext'

module Avm
  module Instances
    class Runner
      class << self
        def instance_class
          ::Avm.const_get(stereotype_name).const_get('Instance')
        end

        def stereotype_module
          ::Avm.const_get(stereotype_name)
        end

        def stereotype_name
          name.demodulize
        end
      end

      description = "Utilities for #{stereotype_name} instances."
      runner_with :help, :subcommands do
        desc description
        pos_arg 'instance-id'
        subcommands
      end

      delegate :instance_class, :stereotype_module, :stereotype_name, to: :class

      private

      def instance_uncached
        self.class.instance_class.by_id(parsed.instance_id)
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 2 rubygems

Version Path
avm-tools-0.99.0 lib/avm/instances/runner.rb
avm-tools-0.98.0 lib/avm/instances/runner.rb
avm-tools-0.97.0 lib/avm/instances/runner.rb
avm-tools-0.96.0 lib/avm/instances/runner.rb
avm-tools-0.95.0 lib/avm/instances/runner.rb
avm-tools-0.94.3 lib/avm/instances/runner.rb
avm-tools-0.94.2 lib/avm/instances/runner.rb
avm-tools-0.94.1 lib/avm/instances/runner.rb
avm-tools-0.94.0 lib/avm/instances/runner.rb
avm-tools-0.93.0 lib/avm/instances/runner.rb
avm-tools-0.92.0 lib/avm/instances/runner.rb
avm-tools-0.91.0 lib/avm/instances/runner.rb
avm-tools-0.90.0 lib/avm/instances/runner.rb
avm-tools-0.89.0 lib/avm/instances/runner.rb
avm-tools-0.88.0 lib/avm/instances/runner.rb