Class: Condom::CV

Inherits:
Base
  • Object
show all
Defined in:
lib/condom/cv.rb

Overview

The CV class. This class is used to produce a résumé.

Instance Attribute Summary collapse

Attributes inherited from Base

#author, #date, #directory, #document_class, #filename, #language, #other_packages, #title

Instance Method Summary collapse

Methods inherited from Base

#get_options, #set_options

Constructor Details

#initialize(args = nil) ⇒ CV

The constructor. Argument could be:

  • nothing,

  • the title of the document,

  • a hash of options.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/condom/cv.rb', line 13

def initialize(args = nil)
  # Need to initialize each variables else they won't exist in instance_variables.
  @theme = @color = nil

  # The default options
  options = {
    :document_class => 'moderncv',
    :title          => 'Curriculum Vitae',
    :filename       => 'cv',
    :theme          => 'classic',
    :color          => 'grey'
  }

  if args.is_a? String
    options[:title] = args
  elsif args.is_a? Hash
    options.merge! args
  end

  super(options)
end

Instance Attribute Details

#colorObject

Returns the value of attribute color.



6
7
8
# File 'lib/condom/cv.rb', line 6

def color
  @color
end

#themeObject

Returns the value of attribute theme.



6
7
8
# File 'lib/condom/cv.rb', line 6

def theme
  @theme
end

Instance Method Details

#createObject

This method will write in the output directory all needed files.



36
37
38
39
40
41
42
43
# File 'lib/condom/cv.rb', line 36

def create
  in_directory do
    # Create files
    build "cv.tex"
    File.rename("cv.tex", "main.tex")
    build "Makefile"
  end
end