Class: LawSchoolOutcomes::School
- Inherits:
-
Object
- Object
- LawSchoolOutcomes::School
- Defined in:
- lib/law_school_outcomes/employment_summary_report/school.rb
Instance Attribute Summary collapse
-
#number_of_lines ⇒ Object
readonly
Returns the value of attribute number_of_lines.
-
#report ⇒ Object
readonly
Returns the value of attribute report.
Instance Method Summary collapse
- #info ⇒ Object
-
#initialize(report) ⇒ School
constructor
A new instance of School.
- #lines ⇒ Object
Constructor Details
#initialize(report) ⇒ School
Returns a new instance of School.
5 6 7 8 |
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 5 def initialize(report) @report = report @number_of_lines = 5 end |
Instance Attribute Details
#number_of_lines ⇒ Object (readonly)
Returns the value of attribute number_of_lines.
3 4 5 |
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 3 def number_of_lines @number_of_lines end |
#report ⇒ Object (readonly)
Returns the value of attribute report.
3 4 5 |
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 3 def report @report end |
Instance Method Details
#info ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 14 def info return { name: lines.first, #.upcase, address:{ street: lines[1].strip, #.upcase, city: city_and_state_and_zip.split(", ").first, state: state_and_zip.split(" ").first, zip: state_and_zip.split(" ").last }, phone: lines[2].split("Phone : ").last.strip, website: lines[4].split("Website : ").last.strip } end |
#lines ⇒ Object
10 11 12 |
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 10 def lines report.lines.first(number_of_lines) end |