Class: MagicModels::Schema::Define

Inherits:
Base
  • Object
show all
Defined in:
lib/magic_models/schema.rb

Instance Attribute Summary collapse

Attributes inherited from Base

#base_class, #connection

Instance Method Summary collapse

Methods inherited from Base

#data_sources, #exclude, #initialize, #models

Constructor Details

This class inherits a constructor from MagicModels::Schema::Base

Instance Attribute Details

#namespaceObject

Returns the value of attribute namespace.



32
33
34
# File 'lib/magic_models/schema.rb', line 32

def namespace
  @namespace
end

Instance Method Details

#evaluate(*args, &block) ⇒ Object



34
35
36
37
38
39
40
# File 'lib/magic_models/schema.rb', line 34

def evaluate(*args, &block)
  if namespace
    namespace.module_eval(*args, &block)
  else
    TOPLEVEL_BINDING.eval(*args, &block)
  end
end