Class: Qrda::Export::Helper::PopulationGroup

Inherits:
Object
  • Object
show all
Includes:
PopulationSelectors
Defined in:
lib/qrda-export/helper/aggregate_object_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from PopulationSelectors

#denominator, #denominator_exceptions, #denominator_exclusions, #method_missing, #multiple_population_types?, #numerator, #population_count, #population_id, #respond_to_missing?

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Qrda::Export::Helper::PopulationSelectors

Instance Attribute Details

#populationsObject

Returns the value of attribute populations.



84
85
86
# File 'lib/qrda-export/helper/aggregate_object_helper.rb', line 84

def populations
  @populations
end

Instance Method Details

#is_cv?Boolean

Returns:

  • (Boolean)


93
94
95
# File 'lib/qrda-export/helper/aggregate_object_helper.rb', line 93

def is_cv?
  populations.any? {|pop| pop.type == 'MSRPOPL'}
end

#performance_rateObject



85
86
87
# File 'lib/qrda-export/helper/aggregate_object_helper.rb', line 85

def performance_rate
  numerator_count.to_f / (performance_rate_denominator)
end

#performance_rate_denominatorObject



89
90
91
# File 'lib/qrda-export/helper/aggregate_object_helper.rb', line 89

def performance_rate_denominator
  denominator_count - denominator_exclusions_count - denominator_exceptions_count
end