Sha256: e44df85a4755e7a6732a31b9f40e4c935232901e19915a023875ff366d6c5fb9

Contents?: true

Size: 1.28 KB

Versions: 10

Compression:

Stored size: 1.28 KB

Contents

module Lotus
  module Utils
    # BasicObject
    #
    # @since 0.3.5
    class BasicObject < ::BasicObject
      # Return the class for debugging purposes.
      #
      # @since 0.3.5
      #
      # @see http://ruby-doc.org/core/Object.html#method-i-class
      def class
        (class << self; self end).superclass
      end

      # Bare minimum inspect for debugging purposes.
      #
      # @return [String] the inspect string
      #
      # @since 0.3.5
      #
      # @see http://ruby-doc.org/core/Object.html#method-i-inspect
      def inspect
        "#<#{ self.class }:#{'%x' % (__id__ << 1)}#{ __inspect }>"
      end

      # Returns true if responds to the given method.
      #
      # @return [TrueClass,FalseClass] the result of the check
      #
      # @since 0.3.5
      #
      # @see http://ruby-doc.org/core-2.2.1/Object.html#method-i-respond_to-3F
      def respond_to?(method_name, include_all = false)
        respond_to_missing?(method_name, include_all)
      end

      private
      # Must be overridden by descendants
      #
      # @since 0.3.5
      # @api private
      def respond_to_missing?(method_name, include_all)
        ::Kernel.raise ::NotImplementedError
      end

      # @since 0.3.5
      # @api private
      def __inspect
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
lotus-utils-0.6.1 lib/lotus/utils/basic_object.rb
lotus-utils-0.6.0 lib/lotus/utils/basic_object.rb
lotus-utils-0.5.2 lib/lotus/utils/basic_object.rb
lotus-utils-0.5.1 lib/lotus/utils/basic_object.rb
lotus-utils-0.5.0 lib/lotus/utils/basic_object.rb
lotus-utils-0.4.3 lib/lotus/utils/basic_object.rb
lotus-utils-0.4.2 lib/lotus/utils/basic_object.rb
lotus-utils-0.4.1 lib/lotus/utils/basic_object.rb
lotus-utils-0.4.0 lib/lotus/utils/basic_object.rb
lotus-utils-0.3.5 lib/lotus/utils/basic_object.rb