Class: Fedex::TrackingInformation::Event

Inherits:
Object
  • Object
show all
Defined in:
lib/fedex/tracking_information/event.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(details = {}) ⇒ Event


9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fedex/tracking_information/event.rb', line 9

def initialize(details = {})
  @description           = details[:event_description]
  @type                  = details[:event_type]
  @occurred_at            = Time.parse(details[:timestamp])
  @city                  = details[:address][:city]
  @state                 = details[:address][:state_or_province_code]
  @postal_code           = details[:address][:postal_code]
  @country               = details[:address][:country_code]
  @residential           = details[:address][:residential] == "true"
  @exception_code        = details[:status_exception_code]
  @exception_description = details[:status_exception_description]
end

Instance Attribute Details

#cityObject (readonly)

Returns the value of attribute city


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def city
  @city
end

#countryObject (readonly)

Returns the value of attribute country


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def country
  @country
end

#descriptionObject (readonly)

Returns the value of attribute description


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def description
  @description
end

#exception_codeObject (readonly)

Returns the value of attribute exception_code


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def exception_code
  @exception_code
end

#exception_descriptionObject (readonly)

Returns the value of attribute exception_description


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def exception_description
  @exception_description
end

#occurred_atObject (readonly) Also known as: occured_at

Returns the value of attribute occurred_at


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def occurred_at
  @occurred_at
end

#postal_codeObject (readonly)

Returns the value of attribute postal_code


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def postal_code
  @postal_code
end

#residentialObject (readonly)

Returns the value of attribute residential


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def residential
  @residential
end

#stateObject (readonly)

Returns the value of attribute state


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def state
  @state
end

#typeObject (readonly)

Returns the value of attribute type


4
5
6
# File 'lib/fedex/tracking_information/event.rb', line 4

def type
  @type
end