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.
11 12 13 |
# File 'lib/simple_cv/basic.rb', line 11 def initialize(config_path) @config = parse_config_file(config_path) end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
9 10 11 |
# File 'lib/simple_cv/basic.rb', line 9 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.
21 22 23 24 25 |
# File 'lib/simple_cv/basic.rb', line 21 def render_file(filename: "SimpleCV", path: nil) output_path = File.join(path || Dir.pwd, "#{filename.chomp('.pdf')}.pdf") Layout.new(config).render_file(output_path) output_path end |