Class: Trackerific::Event

Inherits:
Struct
  • Object
show all
Defined in:
lib/trackerific/event.rb

Overview

Provides details for a tracking event

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dateObject

Returns the value of attribute date

Returns:

  • (Object)

    the current value of date



3
4
5
# File 'lib/trackerific/event.rb', line 3

def date
  @date
end

#descriptionObject

Returns the value of attribute description

Returns:

  • (Object)

    the current value of description



3
4
5
# File 'lib/trackerific/event.rb', line 3

def description
  @description
end

#locationObject

Returns the value of attribute location

Returns:

  • (Object)

    the current value of location



3
4
5
# File 'lib/trackerific/event.rb', line 3

def location
  @location
end

Instance Method Details

#to_sString

Converts the event into a string

Examples:

Get a human-readable string from an event

event = details.event.to_s

Returns:

  • (String)

    converts the event into a string



9
10
11
12
13
14
# File 'lib/trackerific/event.rb', line 9

def to_s
  [ date.strftime('%b %d %I:%M %P'),
    description,
    location
  ].join(" ")
end