Class: Cocina::Models::Mapping::ToMods::IdGenerator
- Inherits:
-
Object
- Object
- Cocina::Models::Mapping::ToMods::IdGenerator
- Defined in:
- lib/cocina/models/mapping/to_mods/id_generator.rb
Overview
Helper class - generates altRepGroup and nameTitleGroup ids.
Instance Method Summary collapse
-
#initialize ⇒ IdGenerator
constructor
A new instance of IdGenerator.
- #next_altrepgroup ⇒ Object
- #next_nametitlegroup ⇒ Object
Constructor Details
#initialize ⇒ IdGenerator
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_altrepgroup ⇒ Object
14 15 16 |
# File 'lib/cocina/models/mapping/to_mods/id_generator.rb', line 14 def next_altrepgroup @alt_rep_group += 1 end |
#next_nametitlegroup ⇒ Object
18 19 20 |
# File 'lib/cocina/models/mapping/to_mods/id_generator.rb', line 18 def next_nametitlegroup @name_title_group += 1 end |