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.
121 122 123 124 |
# File 'lib/mondrian/olap/cube.rb', line 121 def initialize(cube, raw_dimension) @cube = cube @raw_dimension = raw_dimension end |
Instance Attribute Details
#cube ⇒ Object (readonly)
Returns the value of attribute cube.
126 127 128 |
# File 'lib/mondrian/olap/cube.rb', line 126 def cube @cube end |
#raw_dimension ⇒ Object (readonly)
Returns the value of attribute raw_dimension.
126 127 128 |
# File 'lib/mondrian/olap/cube.rb', line 126 def raw_dimension @raw_dimension end |
Instance Method Details
#annotations ⇒ Object
173 174 175 |
# File 'lib/mondrian/olap/cube.rb', line 173 def annotations annotations_for(@raw_dimension) end |
#caption ⇒ Object
136 137 138 |
# File 'lib/mondrian/olap/cube.rb', line 136 def @caption ||= @raw_dimension.getCaption end |
#description ⇒ Object
132 133 134 |
# File 'lib/mondrian/olap/cube.rb', line 132 def description @description ||= @raw_dimension.getDescription end |
#dimension_type ⇒ Object
161 162 163 164 165 166 167 168 169 170 |
# File 'lib/mondrian/olap/cube.rb', line 161 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
140 141 142 |
# File 'lib/mondrian/olap/cube.rb', line 140 def full_name @full_name ||= @raw_dimension.getUniqueName end |
#hierarchies ⇒ Object
144 145 146 |
# File 'lib/mondrian/olap/cube.rb', line 144 def hierarchies @hierarchies ||= @raw_dimension.getHierarchies.map{|h| Hierarchy.new(self, h)} end |
#hierarchy(name = nil) ⇒ Object
152 153 154 155 |
# File 'lib/mondrian/olap/cube.rb', line 152 def hierarchy(name = nil) name ||= self.name hierarchies.detect{|h| h.name == name} end |
#hierarchy_names ⇒ Object
148 149 150 |
# File 'lib/mondrian/olap/cube.rb', line 148 def hierarchy_names hierarchies.map{|h| h.name} end |
#measures? ⇒ Boolean
157 158 159 |
# File 'lib/mondrian/olap/cube.rb', line 157 def measures? @raw_dimension.getDimensionType == Java::OrgOlap4jMetadata::Dimension::Type::MEASURE end |
#name ⇒ Object
128 129 130 |
# File 'lib/mondrian/olap/cube.rb', line 128 def name @name ||= @raw_dimension.getName end |
#visible? ⇒ Boolean
177 178 179 |
# File 'lib/mondrian/olap/cube.rb', line 177 def visible? @raw_dimension.isVisible end |