Class: Baza::Driver::ActiveRecord::Commands

Inherits:
Object
  • Object
show all
Defined in:
lib/baza/driver/active_record/commands.rb

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Commands

Returns a new instance of Commands.



2
3
4
5
# File 'lib/baza/driver/active_record/commands.rb', line 2

def initialize(args)
  @db = args.fetch(:db)
  @proxy_to = ::Baza::Driver.const_get(StringCases.snake_to_camel(@db.driver.driver_type)).const_get(:Commands).new(args)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &blk) ⇒ Object



7
8
9
# File 'lib/baza/driver/active_record/commands.rb', line 7

def method_missing(name, *args, &blk)
  @proxy_to.__send__(name, *args, &blk)
end