Module: Rubiks::Mondrian

Defined in:
lib/rubiks/mondrian.rb,
lib/rubiks/mondrian/member.rb,
lib/rubiks/mondrian/cell_set.rb,
lib/rubiks/mondrian/connection.rb

Defined Under Namespace

Classes: CellSet, Connection, Member

Class Method Summary collapse

Class Method Details

.configObject



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/rubiks/mondrian.rb', line 26

def self.config
  @config ||= begin
    if defined?(ActiveRecord)
      ar_config = ActiveRecord::Base.connection.config

      {
        :driver           => ar_config[:adapter],
        :host             => ar_config[:host],
        :database         => ar_config[:database],
        :username         => ar_config[:username],
        :password         => ar_config[:password]
      }
    else
      {}
    end
  end
end

.config=(new_config) ⇒ Object



22
23
24
# File 'lib/rubiks/mondrian.rb', line 22

def self.config=(new_config)
  @config = new_config
end

.connectionObject



16
17
18
19
20
# File 'lib/rubiks/mondrian.rb', line 16

def self.connection
  @connection ||= ::Rubiks::Mondrian::Connection.create(
    config.merge(:catalog_content => ::Rubiks.schema.to_xml)
  )
end