Sha256: 793e8c0e16656d59361817bb5dd5a0eecbd499f16056505f03100caac80cd27d

Contents?: true

Size: 375 Bytes

Versions: 3

Compression:

Stored size: 375 Bytes

Contents

# frozen_string_literal: true

class ObjectShadow < BasicObject
  def class
    ::ObjectShadow
  end

  def respond_to?(what)
    ::ObjectShadow.instance_methods.include?(what)
  end

  def instance_of?(other)
    other == ::ObjectShadow
  end

  def is_a?(other)
    other.ancestors.include? ::ObjectShadow
  end

  def singleton_class
    class << self; self end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
object_shadow-1.1.1 lib/object_shadow/basic_object.rb
object_shadow-1.1.0 lib/object_shadow/basic_object.rb
object_shadow-1.0.0 lib/object_shadow/basic_object.rb