Class: Bogus::Fake

Inherits:
Object
  • Object
show all
Extended by:
FakeObject, RecordInteractions
Includes:
FakeObject, RecordInteractions
Defined in:
lib/bogus/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/fake.rb', line 12

def initialize(*args)
  __shadow__
end

Class Method Details

.__create__Object



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

alias :__create__ :new

.nameObject



36
37
38
# File 'lib/bogus/fake.rb', line 36

def name
  __copied_class__.name
end

.new(*args, &block) ⇒ Object



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

def new(*args, &block)
  __record__(:new, *args, &block)
  __create__
end

.to_sObject



40
41
42
# File 'lib/bogus/fake.rb', line 40

def to_s
  name
end

Instance Method Details

#instance_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/bogus/fake.rb', line 24

def instance_of?(klass)
  klass == self.class.__copied_class__
end

#kind_of?(klass) ⇒ Boolean

Returns:

  • (Boolean)


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

def kind_of?(klass)
  klass == self.class.__copied_class__
end

#to_sObject



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

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