Class: LawSchoolOutcomes::EmploymentSummaryReport
- Inherits:
-
Object
- Object
- LawSchoolOutcomes::EmploymentSummaryReport
- Defined in:
- lib/law_school_outcomes/employment_summary_report.rb
Defined Under Namespace
Classes: LineCountError
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#year ⇒ Object
readonly
Returns the value of attribute year.
Instance Method Summary collapse
- #domain ⇒ Object (also: #school_name)
- #employment_location_results ⇒ Object
- #employment_status_results ⇒ Object
- #employment_status_section ⇒ Object
- #employment_type_results ⇒ Object
-
#initialize(url: nil, year: 2015) ⇒ EmploymentSummaryReport
constructor
A new instance of EmploymentSummaryReport.
- #results ⇒ Object
- #school_funded_employment_results ⇒ Object
-
#school_info ⇒ Object
def year @year ||= lines[5].gsub("EMPLOYMENT SUMMARY FOR ","").gsub(" GRADUATES","").to_i end.
- #total_grads ⇒ Object
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
#lines ⇒ Object (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 |
#url ⇒ Object (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 |
#year ⇒ Object (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
#domain ⇒ Object 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_results ⇒ Object
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_results ⇒ Object
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_section ⇒ Object
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_results ⇒ Object
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 |
#results ⇒ Object
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_results ⇒ Object
52 53 54 |
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 52 def school_funded_employment_results # todo end |
#school_info ⇒ Object
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_grads ⇒ Object
44 45 46 |
# File 'lib/law_school_outcomes/employment_summary_report.rb', line 44 def total_grads employment_status_section.total_graduates end |