Class: Inspec::RuntimeProfile
- Inherits:
-
Object
- Object
- Inspec::RuntimeProfile
- Defined in:
- lib/inspec/runtime_profile.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
readonly
Returns the value of attribute files.
Instance Method Summary collapse
-
#file(name) ⇒ String
Retrieve a profile file’s contents.
-
#initialize(profile) ⇒ RuntimeProfile
constructor
A new instance of RuntimeProfile.
Constructor Details
#initialize(profile) ⇒ RuntimeProfile
Returns a new instance of RuntimeProfile.
10 11 12 13 14 15 |
# File 'lib/inspec/runtime_profile.rb', line 10 def initialize(profile) @src = profile.source_reader @files = @src.data_files.keys.map do |k| k.sub('files' + File::SEPARATOR, '') end end |
Instance Attribute Details
#files ⇒ Object (readonly)
Returns the value of attribute files.
8 9 10 |
# File 'lib/inspec/runtime_profile.rb', line 8 def files @files end |
Instance Method Details
#file(name) ⇒ String
Retrieve a profile file’s contents
21 22 23 24 |
# File 'lib/inspec/runtime_profile.rb', line 21 def file(name) @src.data_files[File.join('files', name)] || raise("Cannot find file #{name} in profile.") end |