class Piawe::FileParser

Class to read people and rules files and convert them into a PIAWE report

Public Class Methods

new( people_file_name, rules_file_name, report_date_string ) click to toggle source

Create a new FileParser to generate a PIAWE report from files

Parameters

  • people_file_name - Fully qualified path of the people file

  • rules_file_name - Fully qualified path of the rules file

  • report_date_string - Report date to use, in YYYY/MM/DD format

# File lib/piawe/file_parser.rb, line 13
def initialize( people_file_name, rules_file_name, report_date_string )
        @people_file_name = people_file_name
        @rules_file_name = rules_file_name
        @report_date_string = report_date_string
end

Public Instance Methods

report() click to toggle source

Generate a JSON hash containing the PIAWE report

# File lib/piawe/file_parser.rb, line 20
def report
        JSON.pretty_generate( { piawe_report: Piawe.new( people_array, rules_array ).report( report_date ) } )
end