Class: Pubid::Ashrae::Identifiers::Interpretation

Inherits:
SupplementIdentifier show all
Defined in:
lib/pubid/ashrae/identifiers/interpretation.rb

Overview

Interpretation identifier for ASHRAE standards Represents a collection of interpretations for a base standard Examples:

  • Interpretations for Standard 15.2-2022

  • Interpretations for Standard 52.1-1992

Constant Summary collapse

TYPED_STAGES =
[
  Components::TypedStage.new(
    abbr: ["Interpretations"],
    type_code: "interpretation",
    stage_code: "published",
  ),
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from SupplementIdentifier

#code, #publisher

Methods inherited from Base

parse

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

Constructor Details

This class inherits a constructor from Pubid::Identifier

Class Method Details

.typeObject



22
23
24
25
# File 'lib/pubid/ashrae/identifiers/interpretation.rb', line 22

def self.type
  { key: :interpretation, title: "ASHRAE Interpretations",
    short: "Interpretations" }
end

Instance Method Details

#to_sObject



27
28
29
30
31
32
33
34
35
# File 'lib/pubid/ashrae/identifiers/interpretation.rb', line 27

def to_s
  return base_identifier.to_s unless base_identifier

  # Format: Interpretations for Standard 15.2-2022
  base_type = base_identifier.type || "Standard"
  result = "Interpretations for #{base_type} #{base_identifier.code}"
  result += "-#{base_identifier.year}" if base_identifier.year
  result
end