Class: ActiveMerchant::Shipping::ShipmentEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/active_shipping/shipping/shipment_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, time, location, message = nil) ⇒ ShipmentEvent

Returns a new instance of ShipmentEvent


6
7
8
# File 'lib/active_shipping/shipping/shipment_event.rb', line 6

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

Instance Attribute Details

#locationObject (readonly)

Returns the value of attribute location


4
5
6
# File 'lib/active_shipping/shipping/shipment_event.rb', line 4

def location
  @location
end

#messageObject (readonly)

Returns the value of attribute message


4
5
6
# File 'lib/active_shipping/shipping/shipment_event.rb', line 4

def message
  @message
end

#nameObject (readonly)

Returns the value of attribute name


4
5
6
# File 'lib/active_shipping/shipping/shipment_event.rb', line 4

def name
  @name
end

#timeObject (readonly)

Returns the value of attribute time


4
5
6
# File 'lib/active_shipping/shipping/shipment_event.rb', line 4

def time
  @time
end

Instance Method Details

#delivered?Boolean

Returns:

  • (Boolean)

10
11
12
# File 'lib/active_shipping/shipping/shipment_event.rb', line 10

def delivered?
  status == :delivered
end

#statusObject


14
15
16
# File 'lib/active_shipping/shipping/shipment_event.rb', line 14

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