aboutsummaryrefslogtreecommitdiffstats
path: root/lib/carlosgoce/layout/layouts.rb
blob: 946285d78e1f57e0463a999951092b31af200df8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require 'rubygems'
require 'prawn'
require 'prawn/table'

module CarlosGoce
  module Layout
    class Simple
      def create (file, data, year)
        Prawn::Document.generate(file) do
          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
  end
end