module Netposti
Constants
- LOGIN_URL
- VERSION
Public Class Methods
login(opts)
click to toggle source
# File lib/netposti.rb, line 11 def self.login(opts) agent = Mechanize.new agent.pluggable_parser.default = Mechanize::Download page = agent.get(LOGIN_URL) inbox = page.form_with(:name => 'loginForm') do |f| f['login.username'] = opts[:username] f['login.password'] = opts[:password] end.click_button raise LoginError unless inbox.uri.path.match(/messageListPage/) Inbox.new(inbox) end