Class: Bring::Tracking::Event
Instance Method Summary
collapse
Methods inherited from ApiClass
attribute, #error_message, #has_errors?, #initialize
Instance Method Details
#color ⇒ Object
97
98
99
100
101
102
|
# File 'lib/bring/tracking.rb', line 97
def color
case status
when 'READY_FOR_PICKUP' then :yellow
when 'DELIVERED' then :green
end
end
|
#date ⇒ Object
88
89
90
|
# File 'lib/bring/tracking.rb', line 88
def date
@date ||= DateTime.strptime(date_iso)
end
|
#definitions ⇒ Object
92
93
94
95
|
# File 'lib/bring/tracking.rb', line 92
def definitions
return [] if data['definitions'].nil?
data['definitions'].map { |attr| Definition.new attr }
end
|
#postal_code? ⇒ Boolean
84
85
86
|
# File 'lib/bring/tracking.rb', line 84
def postal_code?
!(postal_code.nil? or postal_code.empty?)
end
|