Module: PocztaPolska

Defined in:
lib/poczta_polska.rb,
lib/poczta_polska/event.rb,
lib/poczta_polska/office.rb,
lib/poczta_polska/version.rb,
lib/poczta_polska/tracker.rb,
lib/poczta_polska/package.rb

Defined Under Namespace

Classes: Event, Office, Package, Tracker

Constant Summary collapse

Error =
Class.new(RuntimeError)
UnknownPackageError =
Class.new(Error)
WrongPackageError =
Class.new(Error)
TooManyPackagesError =
Class.new(Error)
ManyPackagesForbiddenError =
Class.new(Error)
DateRangeError =
Class.new(Error)
VERSION =
"0.1.1"

Class Method Summary collapse

Class Method Details

.tracker(username = nil, password = nil) ⇒ Tracker

Creates a Tracker instance. Authentication is optional, it will allow you to check multiple packages in a single request.


17
18
19
20
21
22
23
# File 'lib/poczta_polska.rb', line 17

def self.tracker(username = nil, password = nil)
  if username.nil? && password.nil?
    Tracker.new('https://tt.poczta-polska.pl/Sledzenie/services/Sledzenie?wsdl', 'sledzeniepp', 'PPSA')
  else
    Tracker.new('https://ws.poczta-polska.pl/Sledzenie/services/Sledzenie?wsdl', username, password)
  end
end