Skip to content

Commit

Permalink
Dynamic group methods definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Tensho committed Nov 5, 2015
1 parent ee305e6 commit 00bd6cb
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lib/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,10 @@ def group(name, &block)
@groups.push group
end

def employment(&block)
group("Employment", &block)
end

def education(&block)
group("Education", &block)
end

def open_source(&block)
group("Open Source", &block)
end

def other_experience(&block)
group("Other Experience", &block)
%w(employment education open_source other_experience).each do |group_name|
define_method(group_name) do |&block|
group(group_name.titleize, &block)
end
end

def template(template)
Expand Down

0 comments on commit 00bd6cb

Please sign in to comment.