Class: Pubid::Itu::Identifiers::Amendment
- Inherits:
-
Supplement
- Object
- Lutaml::Model::Serializable
- Pubid::Identifier
- Base
- Supplement
- Pubid::Itu::Identifiers::Amendment
- Defined in:
- lib/pubid/itu/identifiers/amendment.rb
Overview
Amendment identifier (Amd) Pattern: “ITU-T G.989 Amd 1”, “ITU-T G.780/Y.1351 Amd 1 (2004)”
Constant Summary
Constants inherited from Base
Instance Method Summary collapse
Methods inherited from Base
#base_hash, #initialize, normalize_to_s_opts, #publisher, #render_base, #render_language_suffix
Methods inherited from Pubid::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
Constructor Details
This class inherits a constructor from Pubid::Itu::Identifiers::Base
Instance Method Details
#==(other) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/pubid/itu/identifiers/amendment.rb', line 33 def ==(other) return false unless other.is_a?(Amendment) base == other.base && number == other.number && date == other.date end |
#to_s ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/pubid/itu/identifiers/amendment.rb', line 11 def to_s result = base ? base.to_s : "#{publisher}-#{sector}" # Add series if no base if !base && series result += " #{series}" end result += " Amd #{number}" # Add date if present if date result += if date.month " (#{date.month}/#{date.year})" else " (#{date.year})" end end result end |