Sha256: d06ea4ccd116d3f1d82962ce33d52659c3d0eff0d4d4bb7f6deeab7b485fd83a
Contents?: true
Size: 597 Bytes
Versions: 91
Compression:
Stored size: 597 Bytes
Contents
module ActiveShipping class ShipmentEvent attr_reader :name, :time, :location, :message, :type_code def initialize(name, time, location, message = nil, type_code = nil) @name, @time, @location, @message, @type_code = name, time, location, message, type_code end def delivered? status == :delivered end def status @status ||= name.downcase.gsub("\s", "_").to_sym end def ==(other) attributes = %i(name time location message type_code) attributes.all? { |attr| self.public_send(attr) == other.public_send(attr) } end end end
Version data entries
91 entries across 91 versions & 2 rubygems