module RenderSync::Model

Public Class Methods

context() click to toggle source
# File lib/render_sync/model.rb, line 8
def self.context
  Thread.current["model_sync_context"]
end
disable!() click to toggle source
# File lib/render_sync/model.rb, line 17
def self.disable!
  Thread.current["model_sync_enabled"] = false
  Thread.current["model_sync_context"] = nil
end
enable(context = nil) { || ... } click to toggle source
# File lib/render_sync/model.rb, line 22
def self.enable(context = nil)
  enable!(context)
  yield
ensure
  disable!
end
enable!(context = nil) click to toggle source
# File lib/render_sync/model.rb, line 12
def self.enable!(context = nil)
  Thread.current["model_sync_enabled"] = true
  Thread.current["model_sync_context"] = context
end
enabled?() click to toggle source
# File lib/render_sync/model.rb, line 4
def self.enabled?
  Thread.current["model_sync_enabled"]
end