Module: ActiveReporting::Configuration
- Defined in:
- lib/active_reporting/configuration.rb
Class Attribute Summary collapse
-
.ransack_available ⇒ Boolean
Determines if ransack is available for use in the gem.
Class Method Summary collapse
- .config {|_self| ... } ⇒ Object
-
.default_dimension_label ⇒ Object
The default label used by all dimensions if not set otherwise.
-
.default_dimension_label=(dimension_label) ⇒ Symbol
Sets the default dimension label to be used by all dimensions.
-
.default_measure ⇒ Object
The default measture for all fact models.
-
.default_measure=(measure) ⇒ Symbol
Sets the default measture to be used by all fact models.
-
.metric_lookup_class ⇒ Object
Sets the name of the constant used to lookup prebuilt ‘Reporting::Metric` objects by name.
-
.metric_lookup_class=(klass_name) ⇒ Object
Sets the name of the constant used to lookup prebuilt ‘Reporting::Metric` objects by name.
-
.ransack_fallback ⇒ Boolean
Tells if unkown dimension filters should always fallback to ransack.
-
.ransack_fallback=(fallback) ⇒ Boolean
Sets the flag to always fallback to ransack for unknown dimension filters.
Class Attribute Details
.ransack_available ⇒ Boolean
Determines if ransack is available for use in the gem
7 8 9 |
# File 'lib/active_reporting/configuration.rb', line 7 def ransack_available @ransack_available end |
Class Method Details
.config {|_self| ... } ⇒ Object
10 11 12 |
# File 'lib/active_reporting/configuration.rb', line 10 def self.config yield self end |
.default_dimension_label ⇒ Object
The default label used by all dimensions if not set otherwise
Default value is ‘:name`
17 18 19 |
# File 'lib/active_reporting/configuration.rb', line 17 def self.default_dimension_label @default_dimension_label ||= :name end |
.default_dimension_label=(dimension_label) ⇒ Symbol
Sets the default dimension label to be used by all dimensions
25 26 27 |
# File 'lib/active_reporting/configuration.rb', line 25 def self.default_dimension_label=(dimension_label) @default_dimension_label = dimension_label.to_sym end |
.default_measure ⇒ Object
The default measture for all fact models
Default value is ‘:value“
32 33 34 |
# File 'lib/active_reporting/configuration.rb', line 32 def self.default_measure @default_measure ||= :value end |
.default_measure=(measure) ⇒ Symbol
Sets the default measture to be used by all fact models
40 41 42 |
# File 'lib/active_reporting/configuration.rb', line 40 def self.default_measure=(measure) @default_measure = measure.to_sym end |
.metric_lookup_class ⇒ Object
Sets the name of the constant used to lookup prebuilt ‘Reporting::Metric` objects by name. The constant should define a class method called `#lookup` which can take a string or symbol of the metric name.
Default value is ::Metric
76 77 78 |
# File 'lib/active_reporting/configuration.rb', line 76 def self.metric_lookup_class @metric_lookup_class ||= '::Metric' end |
.metric_lookup_class=(klass_name) ⇒ Object
Sets the name of the constant used to lookup prebuilt ‘Reporting::Metric` objects by name.
65 66 67 |
# File 'lib/active_reporting/configuration.rb', line 65 def self.metric_lookup_class=(klass_name) @metric_lookup_class = "::#{klass_name.to_s.classify}" end |
.ransack_fallback ⇒ Boolean
Tells if unkown dimension filters should always fallback to ransack
Default value is ‘false`
49 50 51 |
# File 'lib/active_reporting/configuration.rb', line 49 def self.ransack_fallback @ransack_fallback ||= false end |
.ransack_fallback=(fallback) ⇒ Boolean
Sets the flag to always fallback to ransack for unknown dimension filters
56 57 58 59 |
# File 'lib/active_reporting/configuration.rb', line 56 def self.ransack_fallback=(fallback) raise RansackNotAvailable unless ransack_available @ransack_fallback = fallback end |