Class: Pubid::Nist::Identifiers::FederalInformationProcessingStandards

Inherits:
Base
  • Object
show all
Defined in:
lib/pubid/nist/identifiers/federal_information_processing_standards.rb

Overview

NIST Federal Information Processing Standards (FIPS) Examples:

  • “FIPS 140-3” (no NIST prefix)

  • “NIST FIPS 140-3” (also accepted, normalizes to FIPS 140-3)

Constant Summary collapse

TYPED_STAGES =
[
  Pubid::Components::TypedStage.new(
    abbr: ["FIPS", "NIST FIPS"],
    stage_code: "published",
    type_code: "fips",
  ),
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#edition_greater?, #extract_edition_number, #initialize, #language, #merge, #publisher, #revision, #to_s, #translation, #weight

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_s, #to_supplement_s, #to_urn, #urn_supplement_type, #urn_type_code

Constructor Details

This class inherits a constructor from Pubid::Nist::Identifiers::Base

Class Method Details

.typeObject



24
25
26
27
# File 'lib/pubid/nist/identifiers/federal_information_processing_standards.rb', line 24

def type
  { key: :fips, title: "Federal Information Processing Standards",
    short: "FIPS" }
end

.typed_stagesObject



20
21
22
# File 'lib/pubid/nist/identifiers/federal_information_processing_standards.rb', line 20

def typed_stages
  TYPED_STAGES
end

Instance Method Details

#default_publisherObject

FIPS identifiers default to no publisher prefix



35
36
37
# File 'lib/pubid/nist/identifiers/federal_information_processing_standards.rb', line 35

def default_publisher
  ""
end

#series_codeObject



30
31
32
# File 'lib/pubid/nist/identifiers/federal_information_processing_standards.rb', line 30

def series_code
  "FIPS"
end

#to_mr_styleObject

Override to_mr_style to not add “NIST” prefix for FIPS



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/pubid/nist/identifiers/federal_information_processing_standards.rb', line 40

def to_mr_style
  # "FIPS.46e1977" (machine-readable with dots, no publisher prefix)
  # Note: edition is appended directly to number without dot for FIPS
  result = series_code

  if number
    result += ".#{number}"
    # Append edition directly to number (no dot) for FIPS MR format
    if edition
      result += edition.to_s
    end
  end

  result += parts.map { |p| "-#{p}" }.join if parts&.any?

  result
end