Class: MassiveRecord::Wrapper::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/massive_record/wrapper/base.rb

Class Method Summary collapse

Class Method Details

.configObject



13
14
15
16
# File 'lib/massive_record/wrapper/base.rb', line 13

def self.config
  config = YAML.load_file(::Rails.root.join('config', 'hbase.yml'))[::Rails.env]
  { :host => config['host'], :port => config['port'] }        
end

.connection(opts = {}) ⇒ Object



18
19
20
21
22
# File 'lib/massive_record/wrapper/base.rb', line 18

def self.connection(opts = {})
  conn = ADAPTER::Connection.new(opts.empty? ? config : opts)
  conn.open
  conn
end