Class: MultiformatCV::Project

Inherits:
Object
  • Object
show all
Defined in:
lib/multiformatcv/project.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(h = {}) ⇒ Project

Create Project instance

Example:

project = MultiformatCV::Project.new(name: 'Life Solver (TM)', summary: '...', ...)

Parameters:

  • h (Hash) (defaults to: {})

    Instance initializer; keys MUST be strings

Options Hash (h):

  • 'name' (String)
  • 'position' (String)
  • 'start_date' (String)
  • 'end_date' (String)
  • 'repo' (String)

    Repository URL

  • 'url' (String)

    URL for the project

  • 'summary' (String)

    Project description, goals, etc.

  • 'tasks' (Array<String>)

    Tasks done for the project

  • 'skills' (Array<String>)

    skills used in the project



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/multiformatcv/project.rb', line 30

def initialize(h = {})
  @name = h['name']
  @position = h['position']
  @start_date = h['start_date']
  @end_date = h['end_date']
  @repo = h['repo']
  @summary = h['summary']
  @url = h['url']
  @tasks = []
  @skills = []

  h['tasks'].each  { |t| @tasks << t } if h['tasks']
  h['skills'].each { |t| @skills << t } if h['skills']
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



2
3
4
# File 'lib/multiformatcv/project.rb', line 2

def name
  @name
end

#positionObject

Returns the value of attribute position.



2
3
4
# File 'lib/multiformatcv/project.rb', line 2

def position
  @position
end

#repoObject

Repository URL for the project



9
10
11
# File 'lib/multiformatcv/project.rb', line 9

def repo
  @repo
end

#skillsObject

Returns the value of attribute skills.



2
3
4
# File 'lib/multiformatcv/project.rb', line 2

def skills
  @skills
end

#summaryObject

Returns the value of attribute summary.



2
3
4
# File 'lib/multiformatcv/project.rb', line 2

def summary
  @summary
end

#tasksObject

Returns the value of attribute tasks.



2
3
4
# File 'lib/multiformatcv/project.rb', line 2

def tasks
  @tasks
end

#urlObject

Page or site URL for the project



12
13
14
# File 'lib/multiformatcv/project.rb', line 12

def url
  @url
end

Instance Method Details

#end_dateDateTime

Returns Date or nil.

Returns:

  • (DateTime)

    Date or nil



46
47
48
49
50
51
# File 'lib/multiformatcv/project.rb', line 46

def end_date
  if @end_date and @end_date != ''
    return DateTime.parse(@end_date)
  end
  return nil
end

#start_dateDateTime

Returns Date or nil.

Returns:

  • (DateTime)

    Date or nil



54
55
56
57
58
59
# File 'lib/multiformatcv/project.rb', line 54

def start_date
  if @start_date and @start_date != ''
    return DateTime.parse(@start_date)
  end
  return nil
end