Class: Recruit
Overview
Follows the builder pattern
Instance Attribute Summary collapse
-
#blog ⇒ Object
readonly
Returns the value of attribute blog.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#scope ⇒ Object
readonly
Returns the value of attribute scope.
-
#template ⇒ Object
Returns the value of attribute template.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#blog ⇒ Object (readonly)
Returns the value of attribute blog.
12 13 14 |
# File 'lib/recruit.rb', line 12 def blog @blog end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
11 12 13 |
# File 'lib/recruit.rb', line 11 def email @email end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/recruit.rb', line 10 def name @name end |
#scope ⇒ Object (readonly)
Returns the value of attribute scope.
13 14 15 |
# File 'lib/recruit.rb', line 13 def scope @scope end |
#template ⇒ Object
Returns the value of attribute template.
15 16 17 |
# File 'lib/recruit.rb', line 15 def template @template end |
Class Method Details
.create_resume(*args) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/recruit.rb', line 17 def self.create_resume(*args) APICache.store=APICache::MemoryStore.new recruit = Recruit.new recruit.find_user_data(args[0]) recruit.load_template recruit.generate_resume end |
Instance Method Details
#find_user_data(github_user_name) ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'lib/recruit.rb', line 25 def find_user_data(github_user_name) user = User.find(github_user_name) @scope = { :name => user.name, :email => user.email, :blog_url => user.blog } end |
#generate_resume ⇒ Object
39 40 41 |
# File 'lib/recruit.rb', line 39 def generate_resume Engine.new(@template).render(@scope) end |
#load_template ⇒ Object
35 36 37 |
# File 'lib/recruit.rb', line 35 def load_template @template = File.open(File.join(File.dirname(__FILE__), 'templates', 'default.haml')).read end |