Class: Pubid::CenCenelec::SupplementIdentifier
- Inherits:
-
Identifiers::Base
- Object
- Lutaml::Model::Serializable
- Identifier
- Identifier
- Identifiers::Base
- Pubid::CenCenelec::SupplementIdentifier
- Defined in:
- lib/pubid/cen_cenelec/supplement_identifier.rb
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #copublishers ⇒ Object
-
#publisher ⇒ Object
Delegate methods to base for convenient access.
Methods inherited from Identifiers::Base
Methods inherited from Identifier
Methods inherited from Identifier
apply_mappings, #base, #base_document, concrete_class_for, #dated_version_of?, #draft_of?, #drop_supplements, #edition_of?, #eql?, #exclude, from_hash, #has_supplement?, #hash, #includes?, #initialize, #matches?, #mr_all_parts, #mr_edition, #mr_languages, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_subpart, #mr_supplement_suffix, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #related_to?, #render, #resolve_urn_generator, #root, #sibling_of?, #supplement_of?, #to_hash, #to_mr_string, #to_s, #to_slug, #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
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/pubid/cen_cenelec/supplement_identifier.rb', line 24 def <=>(other) return nil unless other.is_a?(SupplementIdentifier) # Compare base identifiers first base_cmp = base <=> other.base return base_cmp unless base_cmp.zero? # Then compare numbers num_cmp = (number || Components::Code.new(value: "0")).to_s <=> (other.number || Components::Code.new(value: "0")).to_s return num_cmp unless num_cmp.zero? # Finally compare dates if date && other.date date.to_s <=> other.date.to_s elsif date 1 elsif other.date -1 else 0 end end |
#copublishers ⇒ Object
20 21 22 |
# File 'lib/pubid/cen_cenelec/supplement_identifier.rb', line 20 def copublishers base&.copublishers end |
#publisher ⇒ Object
Delegate methods to base for convenient access
16 17 18 |
# File 'lib/pubid/cen_cenelec/supplement_identifier.rb', line 16 def publisher base&.publisher end |