Class: Activecube::Processor::MeasureTables::Entry

Inherits:
Object
  • Object
show all
Defined in:
lib/activecube/processor/measure_tables.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table, index) ⇒ Entry

Returns a new instance of Entry.



7
8
9
10
11
12
# File 'lib/activecube/processor/measure_tables.rb', line 7

def initialize table, index
  @table = table
  @index = index
  @cardinality = index ? index.cardinality : 0
  @cost = 1.0 / (1.0 + cardinality)
end

Instance Attribute Details

#cardinalityObject (readonly)

Returns the value of attribute cardinality.



6
7
8
# File 'lib/activecube/processor/measure_tables.rb', line 6

def cardinality
  @cardinality
end

#costObject (readonly)

Returns the value of attribute cost.



6
7
8
# File 'lib/activecube/processor/measure_tables.rb', line 6

def cost
  @cost
end

#indexObject (readonly)

Returns the value of attribute index.



6
7
8
# File 'lib/activecube/processor/measure_tables.rb', line 6

def index
  @index
end

#tableObject (readonly)

Returns the value of attribute table.



6
7
8
# File 'lib/activecube/processor/measure_tables.rb', line 6

def table
  @table
end