Class: AmplitudeExperiment::Cohort

Inherits:
Object
  • Object
show all
Defined in:
lib/experiment/cohort/cohort.rb

Overview

Cohort

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id, last_modified, size, member_ids, group_type = USER_GROUP_TYPE) ⇒ Cohort



7
8
9
10
11
12
13
# File 'lib/experiment/cohort/cohort.rb', line 7

def initialize(id, last_modified, size, member_ids, group_type = USER_GROUP_TYPE)
  @id = id
  @last_modified = last_modified
  @size = size
  @member_ids = member_ids.to_set
  @group_type = group_type
end

Instance Attribute Details

#group_typeObject

Returns the value of attribute group_type.



5
6
7
# File 'lib/experiment/cohort/cohort.rb', line 5

def group_type
  @group_type
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/experiment/cohort/cohort.rb', line 5

def id
  @id
end

#last_modifiedObject

Returns the value of attribute last_modified.



5
6
7
# File 'lib/experiment/cohort/cohort.rb', line 5

def last_modified
  @last_modified
end

#member_idsObject

Returns the value of attribute member_ids.



5
6
7
# File 'lib/experiment/cohort/cohort.rb', line 5

def member_ids
  @member_ids
end

#sizeObject

Returns the value of attribute size.



5
6
7
# File 'lib/experiment/cohort/cohort.rb', line 5

def size
  @size
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
18
19
20
21
22
23
# File 'lib/experiment/cohort/cohort.rb', line 15

def ==(other)
  return false unless other.is_a?(Cohort)

  @id == other.id &&
    @last_modified == other.last_modified &&
    @size == other.size &&
    @member_ids == other.member_ids &&
    @group_type == other.group_type
end