Class: Olivander::CurrentContext

Inherits:
ActiveSupport::CurrentAttributes
  • Object
show all
Defined in:
lib/olivander/application_context.rb

Constant Summary collapse

DEFAULT_USER_DISPLAY =
'No User Set'.freeze

Instance Method Summary collapse

Instance Method Details

#build {|_self, application_context, user, ability| ... } ⇒ Object

Yields:

  • (_self, application_context, user, ability)

Yield Parameters:



101
102
103
104
105
106
107
# File 'lib/olivander/application_context.rb', line 101

def build(&block)
  self.application_context ||= ::Olivander::ApplicationContext.new
  self.user ||= build_dummy_user
  self.ability ||= build_dummy_ability
  yield(self, application_context, user, ability) if block_given?
  self
end