Class: ResumeTools::Renderer::JSON

Inherits:
Object
  • Object
show all
Defined in:
lib/resumetools/resume/json.rb

Instance Method Summary collapse

Constructor Details

#initialize(resume) ⇒ JSON


4
5
6
# File 'lib/resumetools/resume/json.rb', line 4

def initialize(resume)
  @resume = resume
end

Instance Method Details

#render(opts = {}) ⇒ Object


8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/resumetools/resume/json.rb', line 8

def render(opts={})
  frame = {
    :full_name => @resume.full_name,
    :url => @resume.url,
    :email => @resume.email,
    :telephone => @resume.telephone,
    :address1 => @resume.address1,
    :address2 => @resume.address2,
    :sections => @resume.sections.map { |section| section.json_frame }
  }
  ::JSON.generate(frame)
end