class Martlet::Transcript
Public Class Methods
new(agent)
click to toggle source
# File lib/martlet/transcript.rb, line 3 def initialize(agent) @agent = agent @html = fetch_transcript_html end
Public Instance Methods
fetch_grades()
click to toggle source
# File lib/martlet/transcript.rb, line 8 def fetch_grades records = fetch_records records.inject({}) do |hash, record| hash[record.number] = record.grade hash end end
fetch_records()
click to toggle source
# File lib/martlet/transcript.rb, line 16 def fetch_records parser = TranscriptParser.new(@html) parser.parse_records end
Private Instance Methods
fetch_transcript_html()
click to toggle source
# File lib/martlet/transcript.rb, line 27 def fetch_transcript_html page = @agent.get(transcript_url) page.body end
transcript_url()
click to toggle source
# File lib/martlet/transcript.rb, line 23 def transcript_url 'https://horizon.mcgill.ca/pban1/bzsktran.P_Display_Form?user_type=S&tran_type=V' end