Class: Pubid::Jis::SupplementIdentifier
- Inherits:
-
SingleIdentifier
- Object
- Lutaml::Model::Serializable
- Identifier
- Identifier
- SingleIdentifier
- Pubid::Jis::SupplementIdentifier
- Defined in:
- lib/pubid/jis/supplement_identifier.rb
Overview
Base class for supplement identifiers (Amendment, Explanation) Supplements are modifications to base documents
Direct Known Subclasses
Identifiers::Amendment, Identifiers::Corrigendum, Identifiers::Explanation
Constant Summary
Constants inherited from SingleIdentifier
Pubid::Jis::SingleIdentifier::TYPE_CLASSES
Constants inherited from Identifier
Identifier::JIS_TYPE_MAP, Identifier::PUBLISHER
Instance Attribute Summary
Attributes inherited from SingleIdentifier
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#code ⇒ Object
Inherit the rendered code from the base document.
-
#supplement_notation ⇒ Object
Override in subclasses.
-
#to_s(with_publisher: true, **opts) ⇒ Object
Render as base + supplement notation.
Methods inherited from SingleIdentifier
Methods inherited from Identifier
#all_parts?, from_hash, parse, #reaffirmed?, #symbol_suffix, #year_with_reaffirmation
Methods inherited from Identifier
#base_identifier, #eql?, #exclude, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, #render, #resolve_urn_generator, #root, #to_mr_string, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code, #year
Constructor Details
This class inherits a constructor from Pubid::Identifier
Instance Method Details
#==(other) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/pubid/jis/supplement_identifier.rb', line 40 def ==(other) return false unless other.is_a?(SupplementIdentifier) return false unless other.class == self.class base == other.base && number == other.number && year == other.year end |
#code ⇒ Object
Inherit the rendered code from the base document.
25 26 27 |
# File 'lib/pubid/jis/supplement_identifier.rb', line 25 def code base&.code end |
#supplement_notation ⇒ Object
Override in subclasses
36 37 38 |
# File 'lib/pubid/jis/supplement_identifier.rb', line 36 def supplement_notation raise NotImplementedError, "Subclass must implement supplement_notation" end |
#to_s(with_publisher: true, **opts) ⇒ Object
Render as base + supplement notation
30 31 32 33 |
# File 'lib/pubid/jis/supplement_identifier.rb', line 30 def to_s(with_publisher: true, **opts) @with_publisher = with_publisher render(format: :human, **opts) end |