Class: Mondrian::OLAP::Level
- Inherits:
-
Object
- Object
- Mondrian::OLAP::Level
- Includes:
- Annotated
- Defined in:
- lib/mondrian/olap/cube.rb
Instance Attribute Summary collapse
-
#raw_level ⇒ Object
readonly
Returns the value of attribute raw_level.
Instance Method Summary collapse
- #annotations ⇒ Object
- #caption ⇒ Object
- #cardinality ⇒ Object
- #depth ⇒ Object
- #description ⇒ Object
-
#initialize(hierarchy, raw_level) ⇒ Level
constructor
A new instance of Level.
- #members ⇒ Object
- #members_count ⇒ Object
- #name ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(hierarchy, raw_level) ⇒ Level
Returns a new instance of Level.
231 232 233 234 |
# File 'lib/mondrian/olap/cube.rb', line 231 def initialize(hierarchy, raw_level) @hierarchy = hierarchy @raw_level = raw_level end |
Instance Attribute Details
#raw_level ⇒ Object (readonly)
Returns the value of attribute raw_level.
236 237 238 |
# File 'lib/mondrian/olap/cube.rb', line 236 def raw_level @raw_level end |
Instance Method Details
#annotations ⇒ Object
277 278 279 |
# File 'lib/mondrian/olap/cube.rb', line 277 def annotations annotations_for(@raw_level) end |
#caption ⇒ Object
246 247 248 |
# File 'lib/mondrian/olap/cube.rb', line 246 def @caption ||= @raw_level.getCaption end |
#cardinality ⇒ Object
254 255 256 |
# File 'lib/mondrian/olap/cube.rb', line 254 def cardinality @cardinality = @raw_level.getCardinality end |
#depth ⇒ Object
250 251 252 |
# File 'lib/mondrian/olap/cube.rb', line 250 def depth @raw_level.getDepth end |
#description ⇒ Object
242 243 244 |
# File 'lib/mondrian/olap/cube.rb', line 242 def description @description ||= @raw_level.getDescription end |
#members ⇒ Object
270 271 272 273 274 |
# File 'lib/mondrian/olap/cube.rb', line 270 def members Error.wrap_native_exception do @raw_level.getMembers.map{|m| Member.new(m)} end end |
#members_count ⇒ Object
258 259 260 261 262 263 264 265 266 267 268 |
# File 'lib/mondrian/olap/cube.rb', line 258 def members_count @members_count ||= begin if cardinality >= 0 cardinality else Error.wrap_native_exception do @raw_level.getMembers.size end end end end |
#name ⇒ Object
238 239 240 |
# File 'lib/mondrian/olap/cube.rb', line 238 def name @name ||= @raw_level.getName end |
#visible? ⇒ Boolean
281 282 283 |
# File 'lib/mondrian/olap/cube.rb', line 281 def visible? @raw_level.isVisible end |