Class: Graphene::Percentages

Inherits:
ResultSet show all
Defined in:
lib/graphene/percentages.rb

Overview

Calculates and contains the percent subtotals of each attr (or attr group). Inherits from Graphene::ResultSet. See LazyEnumerable, Graphene::Tablize and Graphene::OneDGraphs for more documentation.

If you passed an options Hash containing :threshold to the constructor, any results falling below it will be excluded.

Don’t create instance manually. Instead, use the Graphene.percentages method, which will return a properly instantiated object.

Instance Attribute Summary

Attributes inherited from ResultSet

#attributes, #options, #resources

Instance Method Summary collapse

Methods inherited from ResultSet

#initialize, #max_result, #over, #to_s

Methods included from OneDGraphs

#bar_chart, #pie_chart, #side_bar_chart, #side_stacked_bar_chart, #spider_chart, #stacked_bar_chart

Methods included from Tablize

#tablize

Methods included from LazyEnumerable

#==, #===, #each, included

Constructor Details

This class inherits a constructor from Graphene::ResultSet

Instance Method Details

#subtotals(opts = nil) ⇒ Object

Convert the percentages to subtotals



14
15
16
# File 'lib/graphene/percentages.rb', line 14

def subtotals(opts=nil)
  @subtotals ||= transmogrify(Subtotals, opts)
end