Sha256: 31a33c6a4e4c6d9380430a0d42f190d211438818a9c8dfb3dc6b0849c94f11f6

Contents?: true

Size: 1006 Bytes

Versions: 15

Compression:

Stored size: 1006 Bytes

Contents

# frozen_string_literal: true

module ConvenientService
  module Utils
    module Module
      class ClassMethodDefined < 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.singleton_class, 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/class_method_defined.rb
convenient_service-0.11.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.10.1 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.10.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.9.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.8.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.7.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.6.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.5.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.4.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.3.1 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.3.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.2.1 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.2.0 lib/convenient_service/utils/module/class_method_defined.rb
convenient_service-0.1.0 lib/convenient_service/utils/module/class_method_defined.rb