Sha256: 8c44f2fe83fd2401d3696c64b0729eb3c1704325fb9ed8c514257a1551577a5f

Contents?: true

Size: 1020 Bytes

Versions: 33

Compression:

Stored size: 1020 Bytes

Contents

# frozen_string_literal: true

require 'eac_ruby_utils/core_ext'
require 'eac_ruby_utils/module_ancestors_variable/set'

module EacCli
  module Runner
    module ForContext
      common_concern

      module ClassMethods
        # @param methods_names [Enumerable<Symbol>]
        # @return [void]
        def for_context(*methods_names)
          for_context_methods.merge(methods_names.map(&:to_sym))
        end

        # @param method_name [Symbol]
        # @return [Boolean]
        def for_context?(method_name)
          for_context_methods.include?(method_name.to_sym)
        end

        private

        # @return [EacRubyUtils::ModuleAncestorsVariable::Set<Symbol>]
        def for_context_methods
          @for_context_methods ||=
            ::EacRubyUtils::ModuleAncestorsVariable::Set.new(self, __method__)
        end
      end

      # @param method_name [Symbol]
      # @return [Boolean]
      def for_context?(method_name)
        self.class.for_context?(method_name)
      end
    end
  end
end

Version data entries

33 entries across 33 versions & 2 rubygems

Version Path
eac_cli-0.42.0 lib/eac_cli/runner/for_context.rb
eac_cli-0.40.1 lib/eac_cli/runner/for_context.rb
eac_cli-0.40.0 lib/eac_cli/runner/for_context.rb
eac_cli-0.39.0 lib/eac_cli/runner/for_context.rb
eac_cli-0.38.1 lib/eac_cli/runner/for_context.rb
eac_tools-0.82.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.81.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.80.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.79.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.78.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.77.1 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.77.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_cli-0.38.0 lib/eac_cli/runner/for_context.rb
eac_tools-0.76.1 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.76.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.75.2 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_cli-0.37.0 lib/eac_cli/runner/for_context.rb
eac_tools-0.75.1 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.75.0 sub/eac_cli/lib/eac_cli/runner/for_context.rb
eac_tools-0.74.1 sub/eac_cli/lib/eac_cli/runner/for_context.rb