Class: Activecube::Processor::MeasureTables::Entry
- Inherits:
-
Object
- Object
- Activecube::Processor::MeasureTables::Entry
- Defined in:
- lib/activecube/processor/measure_tables.rb
Instance Attribute Summary collapse
-
#cardinality ⇒ Object
readonly
Returns the value of attribute cardinality.
-
#cost ⇒ Object
readonly
Returns the value of attribute cost.
-
#index ⇒ Object
readonly
Returns the value of attribute index.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
Instance Method Summary collapse
-
#initialize(table, index) ⇒ Entry
constructor
A new instance of Entry.
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
#cardinality ⇒ Object (readonly)
Returns the value of attribute cardinality.
6 7 8 |
# File 'lib/activecube/processor/measure_tables.rb', line 6 def cardinality @cardinality end |
#cost ⇒ Object (readonly)
Returns the value of attribute cost.
6 7 8 |
# File 'lib/activecube/processor/measure_tables.rb', line 6 def cost @cost end |
#index ⇒ Object (readonly)
Returns the value of attribute index.
6 7 8 |
# File 'lib/activecube/processor/measure_tables.rb', line 6 def index @index end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
6 7 8 |
# File 'lib/activecube/processor/measure_tables.rb', line 6 def table @table end |