Class: Arel::Session
Defined Under Namespace
Modules: CRUD
Class Attribute Summary collapse
-
.instance ⇒ Object
Returns the value of attribute instance.
Class Method Summary collapse
Methods included from CRUD
#create, #delete, #read, #update
Class Attribute Details
.instance ⇒ Object
Returns the value of attribute instance.
4 5 6 |
# File 'lib/arel/session.rb', line 4 def instance @instance end |
Class Method Details
.start ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/arel/session.rb', line 7 def start if defined?(@started) && @started yield else begin @started = true @instance = manufacture singleton_class.class_eval do undef :new alias_method :new, :instance end yield ensure singleton_class.class_eval do undef :new alias_method :new, :manufacture end @started = false end end end |