Module: Nerve::Easy::FixedInstanceId

Included in:
Nerve, Reporter
Defined in:
lib/nerve/easy/fixed_instance_id.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.instance_id(klass_name, size) ⇒ Object



10
11
12
13
# File 'lib/nerve/easy/fixed_instance_id.rb', line 10

def instance_id klass_name, size
  @instance_ids ||= {}
  @instance_ids[klass_name] ||= SecureRandom.hex(size)
end

Instance Method Details

#instance_id(size = 4) ⇒ Object



6
7
8
# File 'lib/nerve/easy/fixed_instance_id.rb', line 6

def instance_id size=4
  FixedInstanceId.instance_id @name, size
end