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-0.10.0 lib/avm/instances/runner.rb
avm-0.9.0 lib/avm/instances/runner.rb
avm-0.8.0 lib/avm/instances/runner.rb
avm-0.7.0 lib/avm/instances/runner.rb
avm-tools-0.110.0 vendor/avm/lib/avm/instances/runner.rb
avm-tools-0.109.1 lib/avm/instances/runner.rb
avm-tools-0.109.0 lib/avm/instances/runner.rb
avm-tools-0.108.0 lib/avm/instances/runner.rb
avm-tools-0.107.0 lib/avm/instances/runner.rb
avm-tools-0.106.0 lib/avm/instances/runner.rb
avm-tools-0.105.0 lib/avm/instances/runner.rb
avm-tools-0.104.0 lib/avm/instances/runner.rb
avm-tools-0.103.1 lib/avm/instances/runner.rb
avm-tools-0.103.0 lib/avm/instances/runner.rb
avm-tools-0.102.2 lib/avm/instances/runner.rb
avm-tools-0.102.1 lib/avm/instances/runner.rb
avm-tools-0.102.0 lib/avm/instances/runner.rb
avm-tools-0.101.0 lib/avm/instances/runner.rb
avm-tools-0.100.0 lib/avm/instances/runner.rb
avm-tools-0.99.1 lib/avm/instances/runner.rb