Class: Pubid::Bipm::Identifiers::Meeting

Inherits:
Pubid::Bipm::Identifier show all
Defined in:
lib/pubid/bipm/identifiers/meeting.rb

Overview

A committee meeting (proceedings). Printed with a naive ordinal derived from the first number component's last digit (as the source data generates it: "11st", "12nd", "13rd"), and ranges keep that first component's ordinal ("100-1th").

Printed forms (all round-trip):

"CGPM 17th Meeting (1983)"             English      (language nil)
"CCAUV 11st Meeting (2017)"            naive ordinal
"CIPM 100-1th Meeting (2011)"          range
"CCAUV 10<sup>e</sup> réunion (2015)"  French       (language "F")

Constant Summary

Constants inherited from Pubid::Bipm::Identifier

Pubid::Bipm::Identifier::BIPM_TYPE_MAP, Pubid::Bipm::Identifier::GROUPS, Pubid::Bipm::Identifier::PUBLISHER, Pubid::Bipm::Identifier::TYPE_CODES, Pubid::Bipm::Identifier::TYPE_NAME_EN, Pubid::Bipm::Identifier::TYPE_NAME_FR, Pubid::Bipm::Identifier::TYPE_WORD_TO_CODE

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pubid::Bipm::Identifier

#exclude, french_connective, #long?, parse, #to_s

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

Class Method Details

.ordinal_suffix(number) ⇒ Object

English ordinal suffix from the first number component's last digit. Naive (matches the source data): 1→st, 2→nd, 3→rd, else→th — no 11/12/13 exception, so "11" → "11st", and a range "22-23" → "22-23nd".



24
25
26
27
28
29
30
31
32
# File 'lib/pubid/bipm/identifiers/meeting.rb', line 24

def self.ordinal_suffix(number)
  first = number.to_s.split("-").first.to_s
  case first[-1]
  when "1" then "st"
  when "2" then "nd"
  when "3" then "rd"
  else "th"
  end
end

.typeObject



17
18
19
# File 'lib/pubid/bipm/identifiers/meeting.rb', line 17

def self.type
  { key: :meeting, web: :meeting, title: "Meeting", short: "meeting" }
end

Instance Method Details

#ordinal_enObject

"15" → "15th", "100-1" → "100-1th".



35
36
37
# File 'lib/pubid/bipm/identifiers/meeting.rb', line 35

def ordinal_en
  "#{number}#{self.class.ordinal_suffix(number)}"
end