Class: ActiveReporting::DimensionFilter
- Inherits:
-
Object
- Object
- ActiveReporting::DimensionFilter
- Defined in:
- lib/active_reporting/dimension_filter.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
-
.build(name, lambda_or_type) ⇒ ActiveReporting::DimensionFilter
Factory for creating a new DimensionFilter.
Instance Method Summary collapse
-
#initialize(name, type = :scope, body = nil) ⇒ DimensionFilter
constructor
A new instance of DimensionFilter.
Constructor Details
#initialize(name, type = :scope, body = nil) ⇒ DimensionFilter
Returns a new instance of DimensionFilter.
24 25 26 27 28 |
# File 'lib/active_reporting/dimension_filter.rb', line 24 def initialize(name, type = :scope, body = nil) @name = name.to_sym @type = type.to_sym @body = body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
3 4 5 |
# File 'lib/active_reporting/dimension_filter.rb', line 3 def body @body end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/active_reporting/dimension_filter.rb', line 3 def type @type end |
Class Method Details
.build(name, lambda_or_type) ⇒ ActiveReporting::DimensionFilter
Factory for creating a new DimensionFilter
Determines the type based on if passed in a callable object or a symbol
12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/active_reporting/dimension_filter.rb', line 12 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 |