Class: LawSchoolOutcomes::EmploymentSummaryReport

Inherits:
Object
  • Object
show all
Defined in:
lib/law_school_outcomes/employment_summary_report.rb

Defined Under Namespace

Classes: LineCountError

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url: nil, year: 2015) ⇒ EmploymentSummaryReport

Returns a new instance of EmploymentSummaryReport.



17
18
19
20
21
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 17

def initialize(url: nil, year: 2015)
  @url = url
  @year = year
  @lines = read_lines
end

Instance Attribute Details

#linesObject (readonly)

Returns the value of attribute lines.



15
16
17
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 15

def lines
  @lines
end

#urlObject (readonly)

Returns the value of attribute url.



15
16
17
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 15

def url
  @url
end

#yearObject (readonly)

Returns the value of attribute year.



15
16
17
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 15

def year
  @year
end

Instance Method Details

#domainObject Also known as: school_name



23
24
25
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 23

def domain
  Domainatrix.parse(url).domain
end

#employment_location_resultsObject



56
57
58
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 56

def employment_location_results
  @employment_location_results ||= EmploymentLocationSection.new(self).results
end

#employment_status_resultsObject



40
41
42
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 40

def employment_status_results
  employment_status_section.results
end

#employment_status_sectionObject



36
37
38
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 36

def employment_status_section
  @employment_status_section ||= EmploymentStatusSection.new(self)
end

#employment_type_resultsObject



48
49
50
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 48

def employment_type_results
  @employment_type_results ||= EmploymentTypeSection.new(self).results
end

#resultsObject



60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 60

def results
  {
    url: url,
    school_name: school_name,
    school_info: school_info,
    year: year,
    total_grads: total_grads,
    #pct_employed_grads: pct_employed_grads,
    employment_outcomes:{
      #total_employed_grads: total_employed_grads,
      statuses: employment_status_results,
      types: employment_type_results,
      locations: employment_location_results
    }
  }
end

#school_funded_employment_resultsObject



52
53
54
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 52

def school_funded_employment_results
  # todo
end

#school_infoObject

def year @year ||= lines[5].gsub("EMPLOYMENT SUMMARY FOR ","").gsub(" GRADUATES","").to_i end



32
33
34
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 32

def school_info
  @school_info || School.new(self).info
end

#total_gradsObject



44
45
46
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 44

def total_grads
  employment_status_section.total_graduates
end