Sha256: 51497e1bbf1b4de00176c314cd0285827ddf4b3be06509b4b644eff4d84cb9a7

Contents?: true

Size: 645 Bytes

Versions: 6

Compression:

Stored size: 645 Bytes

Contents

require 'wagon/household'

module Wagon
  class PhotoDirectory < Page
    def households
      @households ||= _parse_households
    end
    
    def members
      households.collect(&:members).flatten()
    end
    
    def to_pdf(options)
      Prawn::Document.new() do |pdf|
        households.each do |household|
          pdf.text household.name
        end
      end
    end
    
    private
    def _parse_households
      self.search('body > table > tr > td.eventsource[@width="25%"]').collect do |household_td|
        household = Household.create_from_td(connection, household_td)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
wagon-0.9.5 lib/wagon/photo_directory.rb
wagon-0.9.4 lib/wagon/photo_directory.rb
wagon-0.9.3 lib/wagon/photo_directory.rb
wagon-0.9.2 lib/wagon/photo_directory.rb
wagon-0.9.1 lib/wagon/photo_directory.rb
wagon-0.9.0 lib/wagon/photo_directory.rb