module GLSAgent

Constants

ParcelJob
VERSION

Public Class Methods

job_from_csv(string) click to toggle source
# File lib/gls_agent.rb, line 11
def self.job_from_csv string
  fields = string.split(',')
  if fields.length != 8
    fail 'job_from_csv needs 8 fields'
    return nil
  end
  ParcelJob.new(*fields)
end
job_from_hash(hash) click to toggle source
# File lib/gls_agent.rb, line 20
def self.job_from_hash hash
  ParcelJob.new(hash[:date],
                hash[:name],
                hash[:company],
                hash[:street],
                hash[:streetno],
                hash[:zip],
                hash[:city],
                hash[:weight])
end