aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/carlosgoce/calendar.rb14
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/carlosgoce/calendar.rb b/lib/carlosgoce/calendar.rb
index ea5bd6a..46b3bee 100644
--- a/lib/carlosgoce/calendar.rb
+++ b/lib/carlosgoce/calendar.rb
@@ -11,14 +11,14 @@ module CarlosGoce
end
def to_h
- h = {}
- (1..12).each do |month|
- month_name = I18n.t('date.month_names')[month].downcase
- month_days =(1...Time.days_in_month(month, @year)).to_a.each_slice(7).to_a
- h[month_name] = month_days
- end
+ Hash.new.tap {|bar|
+ (1..12).each do |month|
+ month_name = I18n.t('date.month_names')[month].downcase
+ month_days =(1...Time.days_in_month(month, @year)).to_a.each_slice(7).to_a
- h
+ bar[month_name] = month_days
+ end
+ }
end
end
end \ No newline at end of file