Class: Activecube::Processor::Index
- Inherits:
-
Object
- Object
- Activecube::Processor::Index
- Defined in:
- lib/activecube/processor/index.rb
Instance Attribute Summary collapse
-
#cardinality ⇒ Object
readonly
Returns the value of attribute cardinality.
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
Instance Method Summary collapse
- #indexes?(query, measures) ⇒ Boolean
-
#initialize(name, *args) ⇒ Index
constructor
A new instance of Index.
Constructor Details
#initialize(name, *args) ⇒ Index
Returns a new instance of Index.
6 7 8 9 |
# File 'lib/activecube/processor/index.rb', line 6 def initialize name, *args @fields = [name].flatten @cardinality = args.first && args.first[:cardinality] end |
Instance Attribute Details
#cardinality ⇒ Object (readonly)
Returns the value of attribute cardinality.
5 6 7 |
# File 'lib/activecube/processor/index.rb', line 5 def cardinality @cardinality end |
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
5 6 7 |
# File 'lib/activecube/processor/index.rb', line 5 def fields @fields end |
Instance Method Details
#indexes?(query, measures) ⇒ Boolean
11 12 13 |
# File 'lib/activecube/processor/index.rb', line 11 def indexes? query, measures (fields - query.selector_column_names(measures)).empty? end |