Class: Kameleoon::VisitorVisits::Visit

Inherits:
Object
  • Object
show all
Defined in:
lib/kameleoon/data/visitor_visits.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(time_started, time_last_activity = nil) ⇒ Visit

Returns a new instance of Visit.



63
64
65
66
# File 'lib/kameleoon/data/visitor_visits.rb', line 63

def initialize(time_started, time_last_activity = nil)
  @time_started = time_started
  @time_last_activity = time_last_activity || time_started
end

Instance Attribute Details

#time_last_activityObject (readonly)

Returns the value of attribute time_last_activity.



61
62
63
# File 'lib/kameleoon/data/visitor_visits.rb', line 61

def time_last_activity
  @time_last_activity
end

#time_startedObject (readonly)

Returns the value of attribute time_started.



61
62
63
# File 'lib/kameleoon/data/visitor_visits.rb', line 61

def time_started
  @time_started
end

Instance Method Details

#==(other) ⇒ Object



72
73
74
# File 'lib/kameleoon/data/visitor_visits.rb', line 72

def ==(other)
  other.is_a?(Visit) && (@time_started == other.time_started) && (@time_last_activity == other.time_last_activity)
end

#to_sObject



68
69
70
# File 'lib/kameleoon/data/visitor_visits.rb', line 68

def to_s
  "Visit{time_started:#{@time_started},time_last_activity:#{time_last_activity}}"
end