From f690f7da69f7dc9d19df0fdb378ca6a7f89d8a39 Mon Sep 17 00:00:00 2001 From: Carlos Goce Date: Fri, 23 Jan 2015 21:01:34 +0100 Subject: First design of the layout but incomplete --- lib/carlosgoce/layout/layouts.rb | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/carlosgoce/layout/layouts.rb b/lib/carlosgoce/layout/layouts.rb index 8cdb420..946285d 100644 --- a/lib/carlosgoce/layout/layouts.rb +++ b/lib/carlosgoce/layout/layouts.rb @@ -1,12 +1,19 @@ require 'rubygems' -require 'Prawn' +require 'prawn' +require 'prawn/table' module CarlosGoce module Layout class Simple def create (file, data, year) Prawn::Document.generate(file) do - text 'Hello World' + data.each do |k, month| + days = data[k][:days] + + text data[k][:name] + cells = (days).to_a.each_slice(7).to_a + table cells, :cell_style => {:align => :center} + end end end end -- cgit v1.2.3