Class: Martlet::Authenticator

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

Instance Method Summary collapse

Constructor Details

#initialize(agent) ⇒ Authenticator

Returns a new instance of Authenticator.



5
6
7
# File 'lib/martlet/authenticator.rb', line 5

def initialize(agent)
  @agent = agent
end

Instance Method Details

#authenticate(email, password) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/martlet/authenticator.rb', line 9

def authenticate(email, password)
  # Go to login page
   = @agent.get()
  
  # Find and fill login form
  form = ()
  form['sid'] = email
  form['PIN'] = password
  
  (form)
end