Class: AnsibleDocGenerator::DocGenerator::Interpolator::FileExtractor
- Inherits:
-
Object
- Object
- AnsibleDocGenerator::DocGenerator::Interpolator::FileExtractor
- Defined in:
- lib/ansible_doc_generator/doc_generator/interpolator/file_extractor.rb
Instance Attribute Summary collapse
-
#input ⇒ Object
readonly
Returns the value of attribute input.
-
#role_path ⇒ Object
readonly
Returns the value of attribute role_path.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(input, role_path) ⇒ FileExtractor
constructor
A new instance of FileExtractor.
Constructor Details
#initialize(input, role_path) ⇒ FileExtractor
Returns a new instance of FileExtractor.
9 10 11 12 |
# File 'lib/ansible_doc_generator/doc_generator/interpolator/file_extractor.rb', line 9 def initialize input, role_path @input = input @role_path = role_path end |
Instance Attribute Details
#input ⇒ Object (readonly)
Returns the value of attribute input.
7 8 9 |
# File 'lib/ansible_doc_generator/doc_generator/interpolator/file_extractor.rb', line 7 def input @input end |
#role_path ⇒ Object (readonly)
Returns the value of attribute role_path.
7 8 9 |
# File 'lib/ansible_doc_generator/doc_generator/interpolator/file_extractor.rb', line 7 def role_path @role_path end |
Instance Method Details
#call ⇒ Object
14 15 16 17 18 19 20 21 22 23 |
# File 'lib/ansible_doc_generator/doc_generator/interpolator/file_extractor.rb', line 14 def call output = input input.scan(/f\{[^\}]+\}/).each do |interpolation| file_content = get_file_content(interpolation) output.gsub!(interpolation, file_content) end output end |