Module: Cubicle::Data::Member

Included in:
Hierarchy
Defined in:
lib/cubicle/data/member.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#member_nameObject

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_levelObject

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_childrenObject



22
23
24
# File 'lib/cubicle/data/member.rb', line 22

def aggregate_children()
  Cubicle::Data.aggregate(measure_data,measures)
end

#leaf_member?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/cubicle/data/member.rb', line 10

def leaf_member?
  !self.kind_of?(Cubicle::Data::Level)
end

#measure_dataObject



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_valuesObject



6
7
8
# File 'lib/cubicle/data/member.rb', line 6

def measure_values
  @measure_values ||= aggregate_children()
end

#measuresObject



14
15
16
# File 'lib/cubicle/data/member.rb', line 14

def measures
  parent_level.hierarchy.measures
end