Class: Pubid::Bsi::Identifiers::BundledIdentifier

Inherits:
SingleIdentifier show all
Defined in:
lib/pubid/bsi/identifiers/bundled_identifier.rb

Overview

BundledIdentifier represents multiple standards published together Examples:

BS SP 10 & 11:1949
BS 2SP 68 to BS 2SP 71:1973
BS SP 13; 14; 15 and 16:1949
BS 4048:Parts 1 and 2:1966

Instance Method Summary collapse

Methods inherited from SingleIdentifier

#publisher

Methods included from Pubid::Bsi::Identifier

parse

Methods included from IdentifierFacade

#from_hash, #polymorphic_type_map

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



24
25
26
27
28
29
# File 'lib/pubid/bsi/identifiers/bundled_identifier.rb', line 24

def <=>(other)
  return nil unless other.is_a?(BundledIdentifier)

  # Compare first identifier
  identifiers.first <=> other.identifiers.first
end

#to_s(lang: :en, lang_single: false) ⇒ Object



20
21
22
# File 'lib/pubid/bsi/identifiers/bundled_identifier.rb', line 20

def to_s(lang: :en, lang_single: false)
  render(format: :human, lang: lang, lang_single: lang_single)
end