Class: ReportsKit::ModelConfiguration
- Inherits:
-
Object
- Object
- ReportsKit::ModelConfiguration
- Defined in:
- lib/reports_kit/model_configuration.rb
Instance Attribute Summary collapse
-
#autocomplete_scopes ⇒ Object
Returns the value of attribute autocomplete_scopes.
-
#dimensions ⇒ Object
Returns the value of attribute dimensions.
-
#filters ⇒ Object
Returns the value of attribute filters.
Instance Method Summary collapse
- #autocomplete_scope(*scopes) ⇒ Object
- #dimension(key, properties) ⇒ Object
- #filter(key, type_key, properties) ⇒ Object
-
#initialize ⇒ ModelConfiguration
constructor
A new instance of ModelConfiguration.
Constructor Details
#initialize ⇒ ModelConfiguration
Returns a new instance of ModelConfiguration.
5 6 7 8 9 |
# File 'lib/reports_kit/model_configuration.rb', line 5 def initialize self.dimensions = [] self.filters = [] self.autocomplete_scopes = [] end |
Instance Attribute Details
#autocomplete_scopes ⇒ Object
Returns the value of attribute autocomplete_scopes.
3 4 5 |
# File 'lib/reports_kit/model_configuration.rb', line 3 def autocomplete_scopes @autocomplete_scopes end |
#dimensions ⇒ Object
Returns the value of attribute dimensions.
3 4 5 |
# File 'lib/reports_kit/model_configuration.rb', line 3 def dimensions @dimensions end |
#filters ⇒ Object
Returns the value of attribute filters.
3 4 5 |
# File 'lib/reports_kit/model_configuration.rb', line 3 def filters @filters end |
Instance Method Details
#autocomplete_scope(*scopes) ⇒ Object
19 20 21 |
# File 'lib/reports_kit/model_configuration.rb', line 19 def autocomplete_scope(*scopes) self.autocomplete_scopes += scopes.map(&:to_s) end |
#dimension(key, properties) ⇒ Object
11 12 13 |
# File 'lib/reports_kit/model_configuration.rb', line 11 def dimension(key, properties) dimensions << { key: key.to_s }.merge(properties).symbolize_keys end |
#filter(key, type_key, properties) ⇒ Object
15 16 17 |
# File 'lib/reports_kit/model_configuration.rb', line 15 def filter(key, type_key, properties) filters << { key: key.to_s, type_key: type_key }.merge(properties).symbolize_keys end |