Class: SimpleCV::Basic

Inherits:
Object
  • Object
show all
Defined in:
lib/simple_cv/basic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#configObject (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