Sha256: fcaa802e2f1e19141251df1cc4042529be42a1f7fe5c62543019a5966aaac975

Contents?: true

Size: 375 Bytes

Versions: 6

Compression:

Stored size: 375 Bytes

Contents

module ActiveShipping
  class ShipmentEvent
    attr_reader :name, :time, :location, :message

    def initialize(name, time, location, message = nil)
      @name, @time, @location, @message = name, time, location, message
    end

    def delivered?
      status == :delivered
    end

    def status
      @status ||= name.downcase.gsub("\s", "_").to_sym
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
active_shipping-1.0.1 lib/active_shipping/shipment_event.rb
active_shipping-1.0.0 lib/active_shipping/shipment_event.rb
active_shipping-1.0.0.pre4 lib/active_shipping/shipment_event.rb
active_shipping-1.0.0.pre3 lib/active_shipping/shipment_event.rb
active_shipping-1.0.0.pre2 lib/active_shipping/shipment_event.rb
active_shipping-1.0.0.pre1 lib/active_shipping/shipment_event.rb