Class: Cocina::Models::Mapping::ToMods::IdGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/cocina/models/mapping/to_mods/id_generator.rb

Overview

Helper class - generates altRepGroup and nameTitleGroup ids.

Instance Method Summary collapse

Constructor Details

#initializeIdGenerator

Returns a new instance of IdGenerator.



9
10
11
12
# File 'lib/cocina/models/mapping/to_mods/id_generator.rb', line 9

def initialize
  @alt_rep_group = 0
  @name_title_group = 0
end

Instance Method Details

#next_altrepgroupObject



14
15
16
# File 'lib/cocina/models/mapping/to_mods/id_generator.rb', line 14

def next_altrepgroup
  @alt_rep_group += 1
end

#next_nametitlegroupObject



18
19
20
# File 'lib/cocina/models/mapping/to_mods/id_generator.rb', line 18

def next_nametitlegroup
  @name_title_group += 1
end