Method: Tableau::ModuleParser#initialize

Defined in:
lib/tableau/moduleparser.rb

#initialize(module_code = nil) ⇒ ModuleParser

Create a new ModuleParser, with an optional module code



12
13
14
15
16
17
18
19
# File 'lib/tableau/moduleparser.rb', line 12

def initialize(module_code = nil)
  begin
    timetable_response = Tableau::UriBuilder.new(module_code, module_lookup: true).read
    @raw_timetable = Nokogiri::HTML(timetable_response) if timetable_response
  rescue OpenURI::HTTPError
    return nil
  end
end