Class: Scaptimony::GuideGenerator
- Inherits:
-
Object
- Object
- Scaptimony::GuideGenerator
- Defined in:
- app/models/scaptimony/policy.rb
Instance Method Summary collapse
- #each {|sds.html_guide profile_id| ... } ⇒ Object
-
#initialize(p) ⇒ GuideGenerator
constructor
A new instance of GuideGenerator.
Constructor Details
#initialize(p) ⇒ GuideGenerator
Returns a new instance of GuideGenerator.
14 15 16 17 18 19 20 21 22 23 |
# File 'app/models/scaptimony/policy.rb', line 14 def initialize(p) case p when Scaptimony::Policy @scap_content = p.scap_content @profile = p.scap_content_profile end if @scap_content.nil? or @scap_content.source.nil? OpenSCAP.raise! "Cannot generate HTML Guide for #{@scap_content}/#{@profile}" end end |
Instance Method Details
#each {|sds.html_guide profile_id| ... } ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/models/scaptimony/policy.rb', line 25 def each sds = OpenSCAP::DS::Sds.new @scap_content.source sds.select_checklist profile_id = @profile.nil? ? nil : @profile.profile_id yield sds.html_guide profile_id sds.destroy end |