Module: Aggregations::Helpers::AbstractRangeHelper
- Defined in:
- lib/aggregations/helpers/abstract_range_helper.rb
Instance Method Summary collapse
-
#abstract_range_builder ⇒ Object
helper method to add abstract range attributes to aggregation.
-
#add_range(range) ⇒ AbstractRangeHelper
, can be chained for adding multiple ranges.
- #keyed(keyed) ⇒ Object
- #keyed_expr ⇒ Boolean
- #ranges_expr ⇒ Array
Instance Method Details
#abstract_range_builder ⇒ Object
helper method to add abstract range attributes to aggregation.
7 8 9 10 11 12 |
# File 'lib/aggregations/helpers/abstract_range_helper.rb', line 7 def abstract_range_builder builder = {} builder[:ranges] = @ranges if @ranges.present? builder[:keyed] = @keyed if @keyed.present? builder end |
#add_range(range) ⇒ AbstractRangeHelper
Returns , can be chained for adding multiple ranges.
16 17 18 19 20 |
# File 'lib/aggregations/helpers/abstract_range_helper.rb', line 16 def add_range range @ranges ||= [] @ranges << range.settings self end |
#keyed(keyed) ⇒ Object
28 29 30 31 |
# File 'lib/aggregations/helpers/abstract_range_helper.rb', line 28 def keyed keyed @keyed = keyed self end |
#keyed_expr ⇒ Boolean
34 35 36 |
# File 'lib/aggregations/helpers/abstract_range_helper.rb', line 34 def keyed_expr @keyed end |
#ranges_expr ⇒ Array
23 24 25 |
# File 'lib/aggregations/helpers/abstract_range_helper.rb', line 23 def ranges_expr @ranges end |