Class: Fedex::TrackingInformation::Event
- Inherits:
-
Object
- Object
- Fedex::TrackingInformation::Event
- Defined in:
- lib/fedex/tracking_information/event.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
readonly
Returns the value of attribute city.
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#occured_at ⇒ Object
readonly
Returns the value of attribute occured_at.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#residential ⇒ Object
readonly
Returns the value of attribute residential.
-
#state ⇒ Object
readonly
Returns the value of attribute state.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(details = {}) ⇒ Event
constructor
A new instance of Event.
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
#city ⇒ Object (readonly)
Returns the value of attribute city.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def city @city end |
#country ⇒ Object (readonly)
Returns the value of attribute country.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def country @country end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def description @description end |
#occured_at ⇒ Object (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_code ⇒ Object (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 |
#residential ⇒ Object (readonly)
Returns the value of attribute residential.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def residential @residential end |
#state ⇒ Object (readonly)
Returns the value of attribute state.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def state @state end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/fedex/tracking_information/event.rb', line 4 def type @type end |