Class: ResumeStylist::Resume

Inherits:
Object
  • Object
show all
Defined in:
lib/resume-stylist/resume.rb

Constant Summary collapse

Handlers =
[]

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input, resume_format) ⇒ Resume

Returns a new instance of Resume.



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# File 'lib/resume-stylist/resume.rb', line 15

def initialize(input, resume_format)
  @data = {
    "basics" => {
      "name" =>          nil,
      "label" =>         nil,
      "picture" =>       nil,
      "email" =>         nil,
      "phone" =>         nil,
      "website" =>       nil,
      "summary" =>       nil
    },

    "location" => {
      "address" => nil,
      "postalCode" => nil,
      "city" => nil,
      "countryCode" => nil,
      "region" => nil
    },

    "profiles" =>      [], # { network, username, url }
    "work" =>          [], # { organisation, position, website, summary, highlights => [], startDate, endDate }
    "volunteer" =>     [], # { organisation, position, website, summary, highlights => [], startDate, endDate }
    "education" =>     [], # { institution, area, studyType, grade, courses => [], startDate, endDate }
    "publications" =>  [], # { name, publisher, releaseDate, website, summary }
    "skill" =>         [], # { name, level }
    "language" =>      [], # { name, level }
    "reference" =>     [], # { name, reference }

    # @XXX: Remove these?
    "awards" =>        [], # { title, date, awarder, summary }
    "interests" =>     []  # { name, keywords }
  }

  if handler = Handlers.find {|h| h.handles? resume_format }
    handler.instance_method(:load!).bind(self).call(input)
  else
    raise UnsuportedFormatError, "`#{resume_format.to_s}` is not a valid format"
  end

end

Instance Attribute Details

#dataObject

Returns the value of attribute data.



13
14
15
# File 'lib/resume-stylist/resume.rb', line 13

def data
  @data
end

Class Method Details

.register_handler(handler) ⇒ Object



9
10
11
# File 'lib/resume-stylist/resume.rb', line 9

def self.register_handler(handler)
  Handlers << handler
end