Class: Pubid::CenCenelec::Identifiers::Base

Inherits:
Pubid::CenCenelec::Identifier show all
Defined in:
lib/pubid/cen_cenelec/identifiers/base.rb

Overview

Base CEN identifier (one of two roots; see Pubid::CenCenelec::Identifier). Format: PUBLISHER NUMBER:YEAR

Instance Method Summary collapse

Methods inherited from Pubid::CenCenelec::Identifier

parse

Methods inherited from Identifier

#base_identifier, #eql?, #exclude, from_hash, #hash, #initialize, #mr_number, #mr_number_with_part, #mr_part, #mr_publisher, #mr_type, #mr_year, #new_edition_of?, polymorphic_name, polymorphic_type_map, #render, #resolve_urn_generator, #root, #to_hash, #to_mr_string, #to_s, #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



23
24
25
26
27
28
# File 'lib/pubid/cen_cenelec/identifiers/base.rb', line 23

def ==(other)
  return false unless other.is_a?(Base)

  publisher == other.publisher && number == other.number &&
    parts == other.parts && year == other.year
end

#publisherString

Generate URN for this identifier

Returns:

  • (String)

    URN representation



13
# File 'lib/pubid/cen_cenelec/identifiers/base.rb', line 13

attribute :publisher, :string, collection: true