Class: PuppetPdf::PdfCreator
- Inherits:
-
Object
- Object
- PuppetPdf::PdfCreator
- Includes:
- Utils::YarnWrapper
- Defined in:
- lib/puppet_pdf/pdf_creator.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#source ⇒ Object
readonly
Returns the value of attribute source.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source, options = {}) ⇒ PdfCreator
constructor
A new instance of PdfCreator.
Methods included from Utils::YarnWrapper
#run_yarn, #validate_yarn_installation
Constructor Details
#initialize(source, options = {}) ⇒ PdfCreator
Returns a new instance of PdfCreator.
11 12 13 14 15 16 17 18 |
# File 'lib/puppet_pdf/pdf_creator.rb', line 11 def initialize(source, = {}) validate_yarn_installation @source = source @options = .tap do |opt| opt[:output_path] = opt.fetch(:output_path, default_output_path) end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
9 10 11 |
# File 'lib/puppet_pdf/pdf_creator.rb', line 9 def @options end |
#source ⇒ Object (readonly)
Returns the value of attribute source.
9 10 11 |
# File 'lib/puppet_pdf/pdf_creator.rb', line 9 def source @source end |
Instance Method Details
#call ⇒ Object
20 21 22 23 |
# File 'lib/puppet_pdf/pdf_creator.rb', line 20 def call run_yarn(:create_pdf, source, ) [:output_path] end |