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

Returns a new instance of Event.



7
8
9
10
11
12
13
14
15
16
# File 'lib/fedex/tracking_information/event.rb', line 7

def initialize(details = {})
  @description  = details[:event_description]
  @type         = details[:event_type]
  @occured_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"
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

#occured_atObject (readonly)

Returns the value of attribute occured_at.



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

def occured_at
  @occured_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