class Risu::Templates::AssetsTemplate

Public Class Methods

new() click to toggle source
# File lib/risu/templates/assets.rb, line 27
def initialize
        @template_info =
        {
                :name => "assets",
                :author => "hammackj",
                :version => "0.0.3",
                :renderer => "PDF",
                :description => "Generates a Assets Summary Report"
        }
end

Public Instance Methods

render(output) click to toggle source
# File lib/risu/templates/assets.rb, line 38
def render output
        text Report.classification.upcase, :align => :center
        text "\n"

        report_title Report.title
        report_subtitle "Networked Assets"
        report_author "This report was prepared by\n#{Report.author}"

        text "\n\n\n"

        Host.sorted.each do |host|
                text "Name: #{host.name}\n"
                text "FQDN: #{host.fqdn}\n" unless host.fqdn == nil
                text "IP Address: #{host.ip}\n" unless host.ip == nil
                text "NetBios: #{host.netbios}\n" unless host.netbios == nil
                text sprintf "Mac Address: %s\n", host.mac.chomp.gsub("\n", ", ") unless host.mac == nil
                text sprintf "Operation System: %s\n", host.os.chomp.gsub("\n", "/") unless host.os == nil
                text "\n"
        end
end