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.
-
#exception_code ⇒ Object
readonly
Returns the value of attribute exception_code.
-
#exception_description ⇒ Object
readonly
Returns the value of attribute exception_description.
-
#occurred_at ⇒ Object
(also: #occured_at)
readonly
Returns the value of attribute occurred_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.
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
#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 |
#exception_code ⇒ Object (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_description ⇒ Object (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_at ⇒ Object (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_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 |