Class: LawSchoolOutcomes::School

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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_linesObject (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

#reportObject (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

#infoObject



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

#linesObject



10
11
12
# File 'lib/law_school_outcomes/employment_summary_report/school.rb', line 10

def lines
  report.lines.first(number_of_lines)
end