Sha256: df5ab6a74c39a4b181f47bff6fe8415701c5cb23c51bc1bcc681c8272313bf6a

Contents?: true

Size: 693 Bytes

Versions: 3

Compression:

Stored size: 693 Bytes

Contents

require 'wagon/directory'

module Wagon
  class Ward < Page
    def name
      @name ||= self.at('a.channeltitle[href^="/units/home"]').inner_text.strip
    end
    
    def ward_id
      @ward_id ||= @url.sub(%r{^.+\-(\d+),\d+\.html$}, '\1')
    end
    
    def directory_path
      @directory_path ||= "/units/a/directory/photoprint/1,10357,605-1-7-#{ward_id},00.html"
    end
    
    def directory
      @directory ||= Directory.new(connection, directory_path, self)
    end
    
    def households
      directory.households
    end
    
    def members
      households.collect(&:members).flatten()
    end
    
    def to_pdf(options)
      directory.to_pdf(options)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
wagon-2.0.2 lib/wagon/ward.rb
wagon-2.0.1 lib/wagon/ward.rb
wagon-2.0.0 lib/wagon/ward.rb