Class: HappyMapperTools::Benchmark::Ident

Inherits:
Object
  • Object
show all
Includes:
HappyMapper
Defined in:
lib/happy_mapper_tools/benchmark.rb

Overview

Class Ident maps from the ‘ident’ from Benchmark XML file using HappyMapper

Instance Method Summary collapse

Constructor Details

#initialize(ident_str) ⇒ Ident

Returns a new instance of Ident.



68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/happy_mapper_tools/benchmark.rb', line 68

def initialize(ident_str)
  @ident = ident_str
  case ident_str
  when /^(CCI-[0-9]{6})$/
    # Match CCI IDs; e.g. CCI-123456
    @system = 'http://cyber.mil/cci'
  when /^(S?V-[0-9]{5})$/
    # Match SV- IDs; e.g. SV-12345
    # Match V- IDs; e.g. V-12345
    @system = 'http://cyber.mil/legacy'
  else
    # for all other ident_str, use the old identifier
    @system = 'https://public.cyber.mil/stigs/cci/'
  end
end