Class: Kameleoon::VisitorVisits

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(previous_visit_timestamps = []) ⇒ VisitorVisits

Returns a new instance of VisitorVisits.



11
12
13
14
# File 'lib/kameleoon/data/visitor_visits.rb', line 11

def initialize(previous_visit_timestamps = [])
  @previous_visit_timestamps = previous_visit_timestamps
  @previous_visit_timestamps.freeze
end

Instance Attribute Details

#previous_visit_timestampsObject (readonly)

Returns the value of attribute previous_visit_timestamps.



5
6
7
# File 'lib/kameleoon/data/visitor_visits.rb', line 5

def previous_visit_timestamps
  @previous_visit_timestamps
end

Class Method Details

.get_previous_visit_timestamps(visitor_visits) ⇒ Object



16
17
18
# File 'lib/kameleoon/data/visitor_visits.rb', line 16

def self.get_previous_visit_timestamps(visitor_visits)
  visitor_visits.is_a?(VisitorVisits) ? visitor_visits.previous_visit_timestamps : []
end

.visitor_visits?(obj) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/kameleoon/data/visitor_visits.rb', line 20

def self.visitor_visits?(obj)
  obj.nil? || obj.is_a?(VisitorVisits)
end

Instance Method Details

#to_sObject



7
8
9
# File 'lib/kameleoon/data/visitor_visits.rb', line 7

def to_s
  "VisitorVisits{previous_visit_timestamps:#{@previous_visit_timestamps}}"
end