Sha256: 222ba3b3a93a74ba8e2667f1208205e287c9efcbd6d5560f729b20d92cc73d6c

Contents?: true

Size: 993 Bytes

Versions: 15

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Utils
    module Module
      class InstanceMethodDefined < Support::Command
        ##
        # @!attribute [r] mod
        #   @return [Class, Module]
        #
        attr_reader :mod

        ##
        # @!attribute [r] method_name
        #   @return [String, Symbol]
        #
        attr_reader :method_name

        ##
        # @!attribute [r] private
        #   @return [Boolean]
        #
        attr_reader :private

        ##
        # @param mod [Class, Module]
        # @param method_name [String, Symbol]
        # @param private [Boolean]
        # @return [void]
        #
        def initialize(mod, method_name, private: false)
          @mod = mod
          @method_name = method_name
          @private = private
        end

        ##
        # @return [Boolean]
        #
        def call
          Utils::Method.defined?(method_name, mod, private: true)
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
convenient_service-0.12.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.11.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.10.1 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.10.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.9.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.8.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.7.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.6.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.5.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.4.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.3.1 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.3.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.2.1 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.2.0 lib/convenient_service/utils/module/instance_method_defined.rb
convenient_service-0.1.0 lib/convenient_service/utils/module/instance_method_defined.rb