Class: Bogus::Fake

Inherits:
Object
  • Object
show all
Extended by:
FakeObject, RecordInteractions
Includes:
FakeObject, RecordInteractions
Defined in:
lib/bogus/fakes/fake.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from RecordInteractions

__record__, __shadow__

Constructor Details

#initialize(*args) ⇒ Fake

Returns a new instance of Fake.



12
13
14
# File 'lib/bogus/fakes/fake.rb', line 12

def initialize(*args)
  __shadow__
end

Class Method Details

.__create__Object



29
# File 'lib/bogus/fakes/fake.rb', line 29

alias :__create__ :new

.new(*args, &block) ⇒ Object



31
32
33
34
35
# File 'lib/bogus/fakes/fake.rb', line 31

def new(*args, &block)
  value = __record__(:new, *args, &block)
  return value unless ::Bogus::UndefinedReturnValue.undefined?(value)
  __create__
end

Instance Method Details

#kind_of?(klass) ⇒ Boolean Also known as: instance_of?, is_a?

Returns:

  • (Boolean)


20
21
22
23
# File 'lib/bogus/fakes/fake.rb', line 20

def kind_of?(klass)
  copied_class = self.class.__copied_class__
  super || BaseClassIdentifier.base_class?(copied_class, klass)
end

#to_sObject



16
17
18
# File 'lib/bogus/fakes/fake.rb', line 16

def to_s
  "#<#{self.class}:0x#{object_id.to_s(16)}>"
end