Class: Deliveries::TrackingInfo
- Inherits:
-
Object
- Object
- Deliveries::TrackingInfo
- Defined in:
- lib/deliveries/tracking_info.rb
Instance Attribute Summary collapse
-
#checkpoints ⇒ Object
Returns the value of attribute checkpoints.
-
#courier_id ⇒ Object
Returns the value of attribute courier_id.
-
#status ⇒ Object
Returns the value of attribute status.
-
#tracking_code ⇒ Object
Returns the value of attribute tracking_code.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #delivered? ⇒ Boolean
- #in_collection_point? ⇒ Boolean
- #in_transit? ⇒ Boolean
-
#initialize(courier_id:, tracking_code:, status: nil, checkpoints: nil, url: nil) ⇒ TrackingInfo
constructor
A new instance of TrackingInfo.
- #registered? ⇒ Boolean
Constructor Details
#initialize(courier_id:, tracking_code:, status: nil, checkpoints: nil, url: nil) ⇒ TrackingInfo
Returns a new instance of TrackingInfo.
5 6 7 8 9 10 11 |
# File 'lib/deliveries/tracking_info.rb', line 5 def initialize(courier_id:, tracking_code:, status: nil, checkpoints: nil, url: nil) self.courier_id = courier_id self.tracking_code = tracking_code self.status = status self.checkpoints = checkpoints self.url = url end |
Instance Attribute Details
#checkpoints ⇒ Object
Returns the value of attribute checkpoints.
3 4 5 |
# File 'lib/deliveries/tracking_info.rb', line 3 def checkpoints @checkpoints end |
#courier_id ⇒ Object
Returns the value of attribute courier_id.
3 4 5 |
# File 'lib/deliveries/tracking_info.rb', line 3 def courier_id @courier_id end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/deliveries/tracking_info.rb', line 3 def status @status end |
#tracking_code ⇒ Object
Returns the value of attribute tracking_code.
3 4 5 |
# File 'lib/deliveries/tracking_info.rb', line 3 def tracking_code @tracking_code end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/deliveries/tracking_info.rb', line 3 def url @url end |
Instance Method Details
#delivered? ⇒ Boolean
25 26 27 |
# File 'lib/deliveries/tracking_info.rb', line 25 def delivered? status == :delivered end |
#in_collection_point? ⇒ Boolean
21 22 23 |
# File 'lib/deliveries/tracking_info.rb', line 21 def in_collection_point? status == :in_collection_point end |
#in_transit? ⇒ Boolean
17 18 19 |
# File 'lib/deliveries/tracking_info.rb', line 17 def in_transit? status == :in_transit end |
#registered? ⇒ Boolean
13 14 15 |
# File 'lib/deliveries/tracking_info.rb', line 13 def registered? status == :registered end |