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.
7 8 9 10 11 12 |
# File 'lib/inspec/runtime_profile.rb', line 7 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.
5 6 7 |
# File 'lib/inspec/runtime_profile.rb', line 5 def files @files end |
Instance Method Details
#file(name) ⇒ String
Retrieve a profile file’s contents
18 19 20 21 |
# File 'lib/inspec/runtime_profile.rb', line 18 def file(name) @src.data_files[File.join("files", name)] || raise("Cannot find file #{name} in profile.") end |