Class: HappyMapperTools::StigAttributes::DescriptionDetailsType

Inherits:
Object
  • Object
show all
Defined in:
lib/happy_mapper_tools/stig_attributes.rb

Class Method Summary collapse

Class Method Details

.apply(value) ⇒ Object



150
151
152
153
154
155
156
157
158
159
# File 'lib/happy_mapper_tools/stig_attributes.rb', line 150

def apply(value)
  value = value.gsub('&', 'and')
  DescriptionDetails.parse "<Details>#{value}</Details>"
rescue Nokogiri::XML::SyntaxError => e
  if e.to_s.include?('StartTag')
    report_invalid_start_tag(value, e)
  else
    report_disallowed_tags(value)
  end
end

.apply?(value, _convert_to_type) ⇒ Boolean

Returns:

  • (Boolean)


161
162
163
# File 'lib/happy_mapper_tools/stig_attributes.rb', line 161

def apply?(value, _convert_to_type)
  value.is_a?(String)
end

.typeObject



146
147
148
# File 'lib/happy_mapper_tools/stig_attributes.rb', line 146

def type
  DescriptionDetails
end