class ActiveReporting::DimensionFilter

Attributes

body[R]
name[R]
type[R]

Public Class Methods

build(name, lambda_or_type) click to toggle source

Factory for creating a new DimensionFilter

Determines the type based on if passed in a callable object or a symbol

@param name (Symbol) @param lambda_or_type (Symbol, Lambda) @return (ActiveReporting::DimensionFilter) a new instance of a dimension filter

# File lib/active_reporting/dimension_filter.rb, line 14
def self.build(name, lambda_or_type)
  body = nil
  type = lambda_or_type

  if lambda_or_type.respond_to?(:call)
    body = lambda_or_type
    type = :lambda
  end

  new(name, type, body)
end
new(name, type = :scope, body = nil) click to toggle source
# File lib/active_reporting/dimension_filter.rb, line 26
def initialize(name, type = :scope, body = nil)
  @name = name.to_sym
  @type = type.to_sym
  @body = body
end