Module: Cubicle::Data::Member
- Included in:
- Hierarchy
- Defined in:
- lib/cubicle/data/member.rb
Instance Attribute Summary collapse
-
#member_name ⇒ Object
Returns the value of attribute member_name.
-
#parent_level ⇒ Object
Returns the value of attribute parent_level.
Instance Method Summary collapse
- #aggregate_children ⇒ Object
- #leaf_member? ⇒ Boolean
- #measure_data ⇒ Object
- #measure_values ⇒ Object
- #measures ⇒ Object
Instance Attribute Details
#member_name ⇒ Object
Returns the value of attribute member_name.
4 5 6 |
# File 'lib/cubicle/data/member.rb', line 4 def member_name @member_name end |
#parent_level ⇒ Object
Returns the value of attribute parent_level.
4 5 6 |
# File 'lib/cubicle/data/member.rb', line 4 def parent_level @parent_level end |
Instance Method Details
#aggregate_children ⇒ Object
22 23 24 |
# File 'lib/cubicle/data/member.rb', line 22 def aggregate_children() Cubicle::Data.aggregate(measure_data,measures) end |
#leaf_member? ⇒ Boolean
10 11 12 |
# File 'lib/cubicle/data/member.rb', line 10 def leaf_member? !self.kind_of?(Cubicle::Data::Level) end |
#measure_data ⇒ Object
18 19 20 |
# File 'lib/cubicle/data/member.rb', line 18 def measure_data leaf_member? ? self : members.map{|member|member.aggregate_children} end |
#measure_values ⇒ Object
6 7 8 |
# File 'lib/cubicle/data/member.rb', line 6 def measure_values @measure_values ||= aggregate_children() end |
#measures ⇒ Object
14 15 16 |
# File 'lib/cubicle/data/member.rb', line 14 def measures parent_level.hierarchy.measures end |