Class: DHL::Ecommerce::TrackedEvent

Inherits:
Base
  • Object
show all
Includes:
Operations::Find, Operations::List
Defined in:
lib/dhl/ecommerce/tracked_event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Operations::List

included

Methods included from Operations::Find

included

Constructor Details

#initialize(attributes = {}) ⇒ TrackedEvent

Returns a new instance of TrackedEvent.



9
10
11
12
13
14
15
# File 'lib/dhl/ecommerce/tracked_event.rb', line 9

def initialize(attributes = {})
  super attributes

  unless attributes.empty?
    @created_at = Time.parse("#{attributes[:date]} #{attributes[:time]} #{attributes[:time_zone]}") if attributes[:date] && attributes[:time] && attributes[:time_zone]
  end
end

Instance Attribute Details

#created_atObject (readonly)

Returns the value of attribute created_at.



7
8
9
# File 'lib/dhl/ecommerce/tracked_event.rb', line 7

def created_at
  @created_at
end

#eventObject (readonly)

Returns the value of attribute event.



7
8
9
# File 'lib/dhl/ecommerce/tracked_event.rb', line 7

def event
  @event
end

#locationObject (readonly)

Returns the value of attribute location.



7
8
9
# File 'lib/dhl/ecommerce/tracked_event.rb', line 7

def location
  @location
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code.



7
8
9
# File 'lib/dhl/ecommerce/tracked_event.rb', line 7

def postal_code
  @postal_code
end