Class: HashOut::CallRegistry

Inherits:
Object
  • Object
show all
Defined in:
lib/hash_out/call_registry.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash_out_caller) ⇒ CallRegistry

Returns a new instance of CallRegistry.



5
6
7
8
# File 'lib/hash_out/call_registry.rb', line 5

def initialize hash_out_caller
  @times_called    = 0
  @hash_out_caller = hash_out_caller
end

Instance Attribute Details

#hash_out_callerObject (readonly)

Returns the value of attribute hash_out_caller.



3
4
5
# File 'lib/hash_out/call_registry.rb', line 3

def hash_out_caller
  @hash_out_caller
end

Instance Method Details

#delete_caller_from(hash) ⇒ Object



14
15
16
# File 'lib/hash_out/call_registry.rb', line 14

def delete_caller_from hash
  hash.delete hash_out_caller if internal_call?
end

#register_callObject



10
11
12
# File 'lib/hash_out/call_registry.rb', line 10

def register_call
  @times_called += 1
end