Class: SimpleCV::Basic
- Inherits:
-
Object
- Object
- SimpleCV::Basic
- Defined in:
- lib/simple_cv/basic.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
Instance Method Summary collapse
-
#initialize(config_path:) ⇒ Basic
constructor
A new instance of Basic.
-
#render_file(filename: "SimpleCV", path: nil) ⇒ Object
Render file.
Constructor Details
#initialize(config_path:) ⇒ Basic
Returns a new instance of Basic.
10 11 12 |
# File 'lib/simple_cv/basic.rb', line 10 def initialize config_path: @config = build_struct_tree parse_config_file config_path end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
8 9 10 |
# File 'lib/simple_cv/basic.rb', line 8 def config @config end |
Instance Method Details
#render_file(filename: "SimpleCV", path: nil) ⇒ Object
Render file
With given path and filename, pdf can be rendered to a specific location. If no arguments are given, filename will be set to SimpleCV.pdf and pdf will be rendered to current working dir.
20 21 22 23 24 |
# File 'lib/simple_cv/basic.rb', line 20 def render_file filename: "SimpleCV", path: nil output_path = File.join(path || Dir.pwd, "#{filename.chomp('.pdf')}.pdf") Layout.new(config: @config).render_file(output_path) output_path end |