Class: Mondrian::OLAP::Cube
- Inherits:
-
Object
- Object
- Mondrian::OLAP::Cube
- Extended by:
- Forwardable
- Includes:
- Annotated
- Defined in:
- lib/mondrian/olap/cube.rb
Instance Attribute Summary collapse
-
#raw_cube ⇒ Object
readonly
Returns the value of attribute raw_cube.
Class Method Summary collapse
Instance Method Summary collapse
- #annotations ⇒ Object
- #caption ⇒ Object
- #description ⇒ Object
- #dimension(name) ⇒ Object
- #dimension_names ⇒ Object
- #dimensions ⇒ Object
-
#initialize(connection, raw_cube) ⇒ Cube
constructor
A new instance of Cube.
- #member(full_name) ⇒ Object
- #member_by_segments(*segment_names) ⇒ Object
- #name ⇒ Object
- #query ⇒ Object
- #visible? ⇒ Boolean
Constructor Details
#initialize(connection, raw_cube) ⇒ Cube
Returns a new instance of Cube.
27 28 29 30 31 |
# File 'lib/mondrian/olap/cube.rb', line 27 def initialize(connection, raw_cube) @connection = connection @raw_cube = raw_cube @cache_control = CacheControl.new(@connection, self) end |
Instance Attribute Details
#raw_cube ⇒ Object (readonly)
Returns the value of attribute raw_cube.
33 34 35 |
# File 'lib/mondrian/olap/cube.rb', line 33 def raw_cube @raw_cube end |
Class Method Details
Instance Method Details
#annotations ⇒ Object
48 49 50 |
# File 'lib/mondrian/olap/cube.rb', line 48 def annotations annotations_for(@raw_cube) end |
#caption ⇒ Object
43 44 45 |
# File 'lib/mondrian/olap/cube.rb', line 43 def @caption ||= @raw_cube.getCaption end |
#description ⇒ Object
39 40 41 |
# File 'lib/mondrian/olap/cube.rb', line 39 def description @description ||= @raw_cube.getDescription end |
#dimension(name) ⇒ Object
64 65 66 |
# File 'lib/mondrian/olap/cube.rb', line 64 def dimension(name) dimensions.detect{|d| d.name == name} end |
#dimension_names ⇒ Object
60 61 62 |
# File 'lib/mondrian/olap/cube.rb', line 60 def dimension_names dimensions.map{|d| d.name} end |
#dimensions ⇒ Object
56 57 58 |
# File 'lib/mondrian/olap/cube.rb', line 56 def dimensions @dimenstions ||= @raw_cube.getDimensions.map{|d| Dimension.new(self, d)} end |
#member(full_name) ⇒ Object
72 73 74 75 76 |
# File 'lib/mondrian/olap/cube.rb', line 72 def member(full_name) segment_list = Java::OrgOlap4jMdx::IdentifierNode.parseIdentifier(full_name).getSegmentList raw_member = @raw_cube.lookupMember(segment_list) raw_member && Member.new(raw_member) end |
#member_by_segments(*segment_names) ⇒ Object
78 79 80 81 82 |
# File 'lib/mondrian/olap/cube.rb', line 78 def member_by_segments(*segment_names) segment_list = Java::OrgOlap4jMdx::IdentifierNode.ofNames(*segment_names).getSegmentList raw_member = @raw_cube.lookupMember(segment_list) raw_member && Member.new(raw_member) end |
#name ⇒ Object
35 36 37 |
# File 'lib/mondrian/olap/cube.rb', line 35 def name @name ||= @raw_cube.getName end |
#query ⇒ Object
68 69 70 |
# File 'lib/mondrian/olap/cube.rb', line 68 def query Query.from(@connection, name) end |
#visible? ⇒ Boolean
52 53 54 |
# File 'lib/mondrian/olap/cube.rb', line 52 def visible? @raw_cube.isVisible end |