Class: Resume::Resume::ResumeHandler
- Inherits:
-
Object
- Object
- Resume::Resume::ResumeHandler
- Defined in:
- lib/resume.rb
Instance Attribute Summary collapse
-
#about ⇒ Object
readonly
Returns the value of attribute about.
-
#jobs ⇒ Object
readonly
Returns the value of attribute jobs.
-
#schools ⇒ Object
readonly
Returns the value of attribute schools.
-
#sections ⇒ Object
readonly
Returns the value of attribute sections.
Instance Method Summary collapse
- #education(&block) ⇒ Object
-
#initialize ⇒ ResumeHandler
constructor
A new instance of ResumeHandler.
- #job(&block) ⇒ Object
- #section(&block) ⇒ Object
Constructor Details
#initialize ⇒ ResumeHandler
Returns a new instance of ResumeHandler.
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/resume.rb', line 34 def initialize @about = {} @schools = [] @jobs = [] @sections = [] [:name, :email, :address, :url, :phone].each do |field| self.class.class_eval do define_method field do |value| @about[field] = value end end end end |
Instance Attribute Details
#about ⇒ Object (readonly)
Returns the value of attribute about.
32 33 34 |
# File 'lib/resume.rb', line 32 def about @about end |
#jobs ⇒ Object (readonly)
Returns the value of attribute jobs.
32 33 34 |
# File 'lib/resume.rb', line 32 def jobs @jobs end |
#schools ⇒ Object (readonly)
Returns the value of attribute schools.
32 33 34 |
# File 'lib/resume.rb', line 32 def schools @schools end |
#sections ⇒ Object (readonly)
Returns the value of attribute sections.
32 33 34 |
# File 'lib/resume.rb', line 32 def sections @sections end |
Instance Method Details
#education(&block) ⇒ Object
49 50 51 52 53 |
# File 'lib/resume.rb', line 49 def education &block sh = sub_handler [:school, :finished, :will_finish, :degree, :city] block.arity < 1 ? sh.instance_eval(&block) : block.call(sh) @schools << sh.data end |
#job(&block) ⇒ Object
55 56 57 58 59 |
# File 'lib/resume.rb', line 55 def job &block sh = sub_handler [:position, :employer, :city, :date, :description] block.arity < 1 ? sh.instance_eval(&block) : block.call(sh) @jobs << sh.data end |
#section(&block) ⇒ Object
61 62 63 64 65 |
# File 'lib/resume.rb', line 61 def section &block sh = sub_handler [:name, :text, :bullets] block.arity < 1 ? sh.instance_eval(&block) : block.call(sh) @sections << sh.data end |