Sha256: 43784b79ddf2001cd0f311a0f831974363ae74586eba417741f6d52e828a24f2

Contents?: true

Size: 1.52 KB

Versions: 26

Compression:

Stored size: 1.52 KB

Contents

module Foobara
  module Manifest
    class Command < BaseManifest
      self.category_symbol = :command

      def command_manifest
        relevant_manifest
      end

      def command_name
        scoped_short_name
      end

      def full_command_name
        scoped_full_name
      end

      def inputs_type
        Attributes.new(root_manifest, [*path, :inputs_type])
      end

      def result_type
        TypeDeclaration.new(root_manifest, [*path, :result_type])
      rescue Foobara::Manifest::InvalidPath
        nil
      end

      def possible_errors
        super.keys.to_h do |key|
          [key, PossibleError.new(root_manifest, [*path, :possible_errors, key])]
        end
      end

      def types_depended_on
        @types_depended_on ||= self[:types_depended_on].map do |type_reference|
          Type.new(root_manifest, [:type, type_reference])
        end
      end

      def inputs_types_depended_on
        @inputs_types_depended_on ||= self[:inputs_types_depended_on].map do |type_reference|
          Type.new(root_manifest, [:type, type_reference])
        end
      end

      def result_types_depended_on
        @result_types_depended_on ||= self[:result_types_depended_on].to_set do |type_reference|
          Type.new(root_manifest, [:type, type_reference])
        end
      end

      def errors_types_depended_on
        @errors_types_depended_on ||= self[:errors_types_depended_on].to_set do |type_reference|
          Type.new(root_manifest, [:type, type_reference])
        end
      end
    end
  end
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
foobara-0.0.26 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.25 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.24 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.23 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.22 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.21 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.20 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.19 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.18 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.17 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.16 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.15 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.14 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.13 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.12 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.11 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.10 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.9 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.8 projects/manifest/src/foobara/manifest/command.rb
foobara-0.0.7 projects/manifest/src/foobara/manifest/command.rb