Module: CohortScope

Defined in:
lib/cohort_scope.rb,
lib/cohort_scope/cohort.rb,
lib/cohort_scope/version.rb,
lib/cohort_scope/big_cohort.rb,
lib/cohort_scope/strict_cohort.rb,
lib/cohort_scope/active_record_base_class_methods.rb,
lib/cohort_scope/arel_visitors_visitor_instance_methods.rb,
lib/cohort_scope/active_record_relation_instance_methods.rb

Defined Under Namespace

Modules: ActiveRecordBaseClassMethods, ActiveRecordRelationInstanceMethods, ArelVisitorsVisitorInstanceMethods Classes: BigCohort, Cohort, StrictCohort

Constant Summary collapse

VERSION =
'0.3.0'

Class Method Summary collapse

Class Method Details

.conditions_for(characteristics) ⇒ Object



22
23
24
25
26
27
28
29
# File 'lib/cohort_scope.rb', line 22

def self.conditions_for(characteristics)
  case characteristics
  when ::Array
    characteristics.inject({}) { |memo, (k, v)| memo[k] = v; memo }
  when ::Hash
    characteristics
  end
end

.extended(klass) ⇒ Object



14
15
16
17
18
19
20
# File 'lib/cohort_scope.rb', line 14

def self.extended(klass)
  klass.class_eval do
    class << self
      attr_accessor :minimum_cohort_size
    end
  end
end