Class: FmStore::Connection

Inherits:
Object
  • Object
show all
Defined in:
lib/fm_store/connection.rb

Class Method Summary collapse

Class Method Details

.establish_connection(layout) ⇒ Object

Returns an Rfm::Layout which further data request can begin



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fm_store/connection.rb', line 5

def self.establish_connection(layout)
  layout_name = layout.layout
  database_name = layout.database
  
  # Get the config from fm_store.yml
  config = FmStore::Config.instance
  
  server = Rfm::Server.new({
      :host         => config.host,
      :account_name => config.,
      :password     => config.password,
      :ssl          => config.ssl,
      :log_actions  => config.log_actions
  })
  
  server[database_name][layout_name]
end