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)
-
- (Time) date
The date / time of the event.
-
- (String) description
The event’s description.
-
- (Event) initialize(date, description, location)
constructor
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)
Provides a new instance of Event
8 9 10 11 12 |
# File 'lib/trackerific_event.rb', line 8 def initialize(date, description, location) @date = date @description = description @location = location end |
Instance Method Details
- (Time) date
The date / time of the event
15 16 17 |
# File 'lib/trackerific_event.rb', line 15 def date @date end |
- (String) description
The event’s description.
20 21 22 |
# File 'lib/trackerific_event.rb', line 20 def description @description end |
- (String) location
Where the event took place (usually in City State Zip format)
26 27 28 |
# File 'lib/trackerific_event.rb', line 26 def location @location end |
- (String) to_s
Converts the event into a string
31 32 33 34 35 36 |
# File 'lib/trackerific_event.rb', line 31 def to_s dte = self.date.strftime('%b %d %I:%M %P') des = self.description loc = self.location "#{dte} #{des} #{loc}" end |