Class: EgeParser::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/ege_parser.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#auth_agentObject



15
16
17
18
19
20
# File 'lib/ege_parser.rb', line 15

def auth_agent
  @auth_agent ||= Mechanize.new
  @auth_agent.open_timeout=180
  @auth_agent.read_timeout=180
  @auth_agent
end

Instance Method Details

#get_subjects(pupil) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/ege_parser.rb', line 22

def get_subjects pupil
  page = auth_agent.post('http://check.ege.edu.ru/ru/index.php', {
      name:                   pupil.name,
      surname:                pupil.surname,
      patronymic:             pupil.patronymic,
      doc_number:             pupil.passport,
      region:                 pupil.region,
      generate_captcha_val => ''
  })

  generate_subjects page
end