Skip to content

Commit

Permalink
Extract group names constant
Browse files Browse the repository at this point in the history
  • Loading branch information
Tensho committed Nov 5, 2015
1 parent 00bd6cb commit 48f43e9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/document.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,13 @@ class Document
homepage
)

GROUP_NAMES = %w(
employment
education
open_source
other_experience
)

def initialize
@data = {}
@groups = []
Expand All @@ -36,8 +43,8 @@ def group(name, &block)
group.instance_eval &block
@groups.push group
end

%w(employment education open_source other_experience).each do |group_name|
GROUP_NAMES.each do |group_name|
define_method(group_name) do |&block|
group(group_name.titleize, &block)
end
Expand Down

0 comments on commit 48f43e9

Please sign in to comment.