Class: Trackerific::Event
- Inherits:
-
Object
- Object
- Trackerific::Event
- Defined in:
- lib/trackerific/event.rb
Overview
Provides details for a tracking event
Instance Method Summary (collapse)
-
- (DateTime) date
The date and time of the event.
-
- (String) description
The event’s description.
-
- (Event) initialize(date, description, location)
constructor
Private
Provides a new instance of Event.
-
- (String) location
Where the event took place (usually in City State Zip format).
-
- (String) to_s
Converts the event into a string.
Constructor Details
- (Event) initialize(date, description, location)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Provides a new instance of Event
9 10 11 12 13 |
# File 'lib/trackerific/event.rb', line 9 def initialize(date, description, location) @date = date @description = description @location = location end |
Instance Method Details
- (DateTime) date
The date and time of the event
20 21 22 |
# File 'lib/trackerific/event.rb', line 20 def date @date end |
- (String) description
The event’s description
29 30 31 |
# File 'lib/trackerific/event.rb', line 29 def description @description end |
- (String) location
Where the event took place (usually in City State Zip format)
38 39 40 |
# File 'lib/trackerific/event.rb', line 38 def location @location end |
- (String) to_s
Converts the event into a string
51 52 53 54 55 56 |
# File 'lib/trackerific/event.rb', line 51 def to_s dte = self.date.strftime('%b %d %I:%M %P') des = self.description loc = self.location "#{dte} #{des} #{loc}" end |