Class: PlainQuery::BuilderOptions

Inherits:
Module
  • Object
show all
Defined in:
lib/plain_query/builder_options.rb

Instance Method Summary collapse

Constructor Details

#initialize(model: nil) ⇒ BuilderOptions

Returns a new instance of BuilderOptions.



5
6
7
# File 'lib/plain_query/builder_options.rb', line 5

def initialize(model: nil)
  define_model(model)
end

Instance Method Details

#define_model(model) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/plain_query/builder_options.rb', line 9

def define_model(model)
  module_exec(model) do |model_name|
    define_method(:model) do
      model_name
    end
  end
end