Class: AmplitudeExperiment::Cohort
- Inherits:
-
Object
- Object
- AmplitudeExperiment::Cohort
- Defined in:
- lib/experiment/cohort/cohort.rb
Overview
Cohort
Instance Attribute Summary collapse
-
#group_type ⇒ Object
Returns the value of attribute group_type.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_modified ⇒ Object
Returns the value of attribute last_modified.
-
#member_ids ⇒ Object
Returns the value of attribute member_ids.
-
#size ⇒ Object
Returns the value of attribute size.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(id, last_modified, size, member_ids, group_type = USER_GROUP_TYPE) ⇒ Cohort
constructor
A new instance of Cohort.
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_type ⇒ Object
Returns the value of attribute group_type.
5 6 7 |
# File 'lib/experiment/cohort/cohort.rb', line 5 def group_type @group_type end |
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/experiment/cohort/cohort.rb', line 5 def id @id end |
#last_modified ⇒ Object
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_ids ⇒ Object
Returns the value of attribute member_ids.
5 6 7 |
# File 'lib/experiment/cohort/cohort.rb', line 5 def member_ids @member_ids end |
#size ⇒ Object
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 |