Class: Async::RSpec::Memory::Allocation

Inherits:
Struct
  • Object
show all
Defined in:
lib/async/rspec/memory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#countObject

Returns the value of attribute count

Returns:

  • (Object)

    the current value of count



27
28
29
# File 'lib/async/rspec/memory.rb', line 27

def count
  @count
end

#sizeObject

Returns the value of attribute size

Returns:

  • (Object)

    the current value of size



27
28
29
# File 'lib/async/rspec/memory.rb', line 27

def size
  @size
end

Instance Method Details

#<<(object) ⇒ Object



28
29
30
31
# File 'lib/async/rspec/memory.rb', line 28

def << object
  self.count += 1
  self.size += ObjectSpace.memsize_of(object)
end