require 'rubiks' require 'yaml' module ::Rubiks module Examples # This example is taken from the Mondrian documentation: # http://mondrian.pentaho.com/documentation/schema.php#Cubes_and_dimensions # then modified to use Rails/Rubiks conventions # # We want the output to be: # # # # # # # # #
# # # # # # # # # # # # # # # class MondrianDocs class << self def filename File.expand_path('../../../examples/mondrian_docs.yml', __FILE__) end def file_contents File.read(self.filename) end def hash YAML.load_file(self.filename) end def schema ::Rubiks::Schema.new_from_hash(self.hash) end def to_xml self.schema.to_xml end end end end end