Sha256: afa2ba777a56f3dd569b469a46b1b0e0e75833dd92e45722acd4cb3cc99b04c6

Contents?: true

Size: 1.83 KB

Versions: 1

Compression:

Stored size: 1.83 KB

Contents

require 'fedex_ship/request/base'
require 'logger'
module FedexShip
  module Request
    class LogsFedex < Base

      def ship_serv_log(info)
        begin
          date = Date.today.to_s
          info = (Time.now).to_s + ' ' + info
          log = File.open('log/shipment_' + date + '.log','a')
          log.puts(info)
          log.close
        rescue Exception => ex.to_s
          puts ex.to_s
          log.close
        end
      end

      def rate_serv_log(info)
        begin
          date = Date.today.to_s
          info = (Time.now).to_s + ' ' + info
          log = File.open('log/rate_' + date + '.log','a')
          log.puts(info)
          log.close
        rescue Exception => ex.to_s
          puts ex.to_s
          log.close
        end
      end

      def track_serv_log(info)
        begin
          date = Date.today.to_s
          info = (Time.now).to_s + ' ' + info
          log = File.open('log/track_' + date + '.log','a')
          log.puts(info)
          log.close
        rescue Exception => ex.to_s
          puts ex.to_s
          log.close
        end
      end

      def pickup_serv_log(info)
        begin
          date = Date.today.to_s
          info = (Time.now).to_s + ' ' + info
          log = File.open('log/pickup_' + date + '.log','a')
          log.puts(info)
          log.close
        rescue Exception => ex.to_s
          puts ex.to_s
          log.close
        end
      end

      def delete_ship_serv_log(info)
        begin
          date = Date.today.to_s
          info = (Time.now).to_s + ' ' + info
          log = File.open('log/delete_shipment_' + date + '.log','a')
          log.puts(info)
          log.close
        rescue Exception => ex.to_s
          puts ex.to_s
          log.close
        end
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
fedex_ship-0.1.0 lib/fedex_ship/request/logs_fedex.rb