Class: Pubid::Components::Iteration

Inherits:
Lutaml::Model::Serializable
  • Object
show all
Defined in:
lib/pubid/components/iteration.rb

Overview

Stage iteration component — the numeric suffix on a stage (e.g., “WD.2”).

Renders as the bare number; the caller decides the separator (“.”) because URN, MR, and human formats position iteration differently relative to the stage abbreviation.

Instance Method Summary collapse

Instance Method Details

#eql?(other) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
28
29
# File 'lib/pubid/components/iteration.rb', line 25

def eql?(other)
  return false unless other.is_a?(self.class)

  number == other.number
end

#hashObject



21
22
23
# File 'lib/pubid/components/iteration.rb', line 21

def hash
  @hash ||= number.hash
end

#render(context: nil) ⇒ Object



17
18
19
# File 'lib/pubid/components/iteration.rb', line 17

def render(context: nil)
  number.to_s
end

#to_sObject



13
14
15
# File 'lib/pubid/components/iteration.rb', line 13

def to_s
  number.to_s
end