Class: Scaptimony::ScapContent
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- Scaptimony::ScapContent
- Defined in:
- app/models/scaptimony/scap_content.rb
Instance Method Summary collapse
-
#benchmark_profiles ⇒ Object
returns OpenSCAP::Xccdf::Benchmark with profiles.
- #digest ⇒ Object
- #source ⇒ Object
- #to_label ⇒ Object
Instance Method Details
#benchmark_profiles ⇒ Object
returns OpenSCAP::Xccdf::Benchmark with profiles.
62 63 64 65 66 67 68 |
# File 'app/models/scaptimony/scap_content.rb', line 62 def benchmark_profiles sds = ::OpenSCAP::DS::Sds.new(source) bench_source = sds.select_checklist! benchmark = ::OpenSCAP::Xccdf::Benchmark.new(bench_source) sds.destroy benchmark end |
#digest ⇒ Object
57 58 59 |
# File 'app/models/scaptimony/scap_content.rb', line 57 def digest self[:digest] ||= Digest::SHA256.hexdigest "#{scap_file}" end |
#source ⇒ Object
53 54 55 |
# File 'app/models/scaptimony/scap_content.rb', line 53 def source @source ||= source_init end |
#to_label ⇒ Object
49 50 51 |
# File 'app/models/scaptimony/scap_content.rb', line 49 def to_label title end |