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.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#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.
26 27 28 29 30 |
# 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 |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
5 6 7 |
# File 'lib/active_reporting/dimension_filter.rb', line 5 def body @body end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/active_reporting/dimension_filter.rb', line 5 def name @name end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/active_reporting/dimension_filter.rb', line 5 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
14 15 16 17 18 19 20 21 22 23 24 |
# 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 |