Class: Mondrian::OLAP::Dimension
- Inherits:
-
Object
- Object
- Mondrian::OLAP::Dimension
- Includes:
- Annotated
- Defined in:
- lib/mondrian/olap/cube.rb
Instance Attribute Summary collapse
-
#cube ⇒ Object
readonly
Returns the value of attribute cube.
-
#raw_dimension ⇒ Object
readonly
Returns the value of attribute raw_dimension.
Instance Method Summary collapse
- #annotations ⇒ Object
- #caption ⇒ Object
- #description ⇒ Object
- #dimension_type ⇒ Object
- #full_name ⇒ Object
- #hierarchies ⇒ Object
- #hierarchy(name = nil) ⇒ Object
- #hierarchy_names ⇒ Object
-
#initialize(cube, raw_dimension) ⇒ Dimension
constructor
A new instance of Dimension.
- #measures? ⇒ Boolean
- #name ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(cube, raw_dimension) ⇒ Dimension
Returns a new instance of Dimension.
83 84 85 86 |
# File 'lib/mondrian/olap/cube.rb', line 83 def initialize(cube, raw_dimension) @cube = cube @raw_dimension = raw_dimension end |
Instance Attribute Details
#cube ⇒ Object (readonly)
Returns the value of attribute cube.
88 89 90 |
# File 'lib/mondrian/olap/cube.rb', line 88 def cube @cube end |
#raw_dimension ⇒ Object (readonly)
Returns the value of attribute raw_dimension.
88 89 90 |
# File 'lib/mondrian/olap/cube.rb', line 88 def raw_dimension @raw_dimension end |
Instance Method Details
#annotations ⇒ Object
135 136 137 |
# File 'lib/mondrian/olap/cube.rb', line 135 def annotations annotations_for(@raw_dimension) end |
#caption ⇒ Object
98 99 100 |
# File 'lib/mondrian/olap/cube.rb', line 98 def @caption ||= @raw_dimension.getCaption end |
#description ⇒ Object
94 95 96 |
# File 'lib/mondrian/olap/cube.rb', line 94 def description @description ||= @raw_dimension.getDescription end |
#dimension_type ⇒ Object
123 124 125 126 127 128 129 130 131 132 |
# File 'lib/mondrian/olap/cube.rb', line 123 def dimension_type case @raw_dimension.getDimensionType when Java::OrgOlap4jMetadata::Dimension::Type::TIME :time when Java::OrgOlap4jMetadata::Dimension::Type::MEASURE :measures else :standard end end |
#full_name ⇒ Object
102 103 104 |
# File 'lib/mondrian/olap/cube.rb', line 102 def full_name @full_name ||= @raw_dimension.getUniqueName end |
#hierarchies ⇒ Object
106 107 108 |
# File 'lib/mondrian/olap/cube.rb', line 106 def hierarchies @hierarchies ||= @raw_dimension.getHierarchies.map{|h| Hierarchy.new(self, h)} end |
#hierarchy(name = nil) ⇒ Object
114 115 116 117 |
# File 'lib/mondrian/olap/cube.rb', line 114 def hierarchy(name = nil) name ||= self.name hierarchies.detect{|h| h.name == name} end |
#hierarchy_names ⇒ Object
110 111 112 |
# File 'lib/mondrian/olap/cube.rb', line 110 def hierarchy_names hierarchies.map{|h| h.name} end |
#measures? ⇒ Boolean
119 120 121 |
# File 'lib/mondrian/olap/cube.rb', line 119 def measures? @raw_dimension.getDimensionType == Java::OrgOlap4jMetadata::Dimension::Type::MEASURE end |
#name ⇒ Object
90 91 92 |
# File 'lib/mondrian/olap/cube.rb', line 90 def name @name ||= @raw_dimension.getName end |
#visible? ⇒ Boolean
139 140 141 |
# File 'lib/mondrian/olap/cube.rb', line 139 def visible? @raw_dimension.isVisible end |