Class: ActiveWarehouse::AggregateKey
- Inherits:
-
Object
- Object
- ActiveWarehouse::AggregateKey
- Defined in:
- lib/active_warehouse/aggregate.rb
Overview
Key for aggregate caching
Instance Attribute Summary collapse
-
#dimension1 ⇒ Object
readonly
Returns the value of attribute dimension1.
-
#dimension1_hierarchy ⇒ Object
readonly
Returns the value of attribute dimension1_hierarchy.
-
#dimension2 ⇒ Object
readonly
Returns the value of attribute dimension2.
-
#dimension2_hierarchy ⇒ Object
readonly
Returns the value of attribute dimension2_hierarchy.
Instance Method Summary collapse
- #==(o) ⇒ Object
- #hash ⇒ Object
-
#initialize(dimension1, dimension1_hierarchy, dimension2, dimension2_hierarchy) ⇒ AggregateKey
constructor
A new instance of AggregateKey.
-
#to_rs ⇒ Object
Return the “reveresed” version of this key String representation.
- #to_s ⇒ Object
Constructor Details
#initialize(dimension1, dimension1_hierarchy, dimension2, dimension2_hierarchy) ⇒ AggregateKey
Returns a new instance of AggregateKey.
234 235 236 237 238 239 |
# File 'lib/active_warehouse/aggregate.rb', line 234 def initialize(dimension1, dimension1_hierarchy, dimension2, dimension2_hierarchy) @dimension1 = dimension1 @dimension1_hierarchy = dimension1_hierarchy @dimension2 = dimension2 @dimension2_hierarchy = dimension2_hierarchy end |
Instance Attribute Details
#dimension1 ⇒ Object (readonly)
Returns the value of attribute dimension1.
232 233 234 |
# File 'lib/active_warehouse/aggregate.rb', line 232 def dimension1 @dimension1 end |
#dimension1_hierarchy ⇒ Object (readonly)
Returns the value of attribute dimension1_hierarchy.
232 233 234 |
# File 'lib/active_warehouse/aggregate.rb', line 232 def dimension1_hierarchy @dimension1_hierarchy end |
#dimension2 ⇒ Object (readonly)
Returns the value of attribute dimension2.
232 233 234 |
# File 'lib/active_warehouse/aggregate.rb', line 232 def dimension2 @dimension2 end |
#dimension2_hierarchy ⇒ Object (readonly)
Returns the value of attribute dimension2_hierarchy.
232 233 234 |
# File 'lib/active_warehouse/aggregate.rb', line 232 def dimension2_hierarchy @dimension2_hierarchy end |
Instance Method Details
#==(o) ⇒ Object
241 242 243 |
# File 'lib/active_warehouse/aggregate.rb', line 241 def ==(o) o.instance_of?(self.class) and (o.to_s == to_s or o.to_s = to_rs) end |
#hash ⇒ Object
245 246 247 |
# File 'lib/active_warehouse/aggregate.rb', line 245 def hash to_s.hash end |
#to_rs ⇒ Object
Return the “reveresed” version of this key String representation
254 255 256 |
# File 'lib/active_warehouse/aggregate.rb', line 254 def to_rs "#{@dimension2}.#{@dimension2_hierarchy}.#{@dimension1}.#{@dimension1_hierarchy}" end |
#to_s ⇒ Object
249 250 251 |
# File 'lib/active_warehouse/aggregate.rb', line 249 def to_s "#{@dimension1}.#{@dimension1_hierarchy}.#{@dimension2}.#{@dimension2_hierarchy}" end |