Class: Olivander::CurrentContext

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

Instance Method Summary collapse

Instance Method Details

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

Yields:

  • (_self, application_context, user, ability)

Yield Parameters:



68
69
70
71
72
73
74
# File 'lib/olivander/application_context.rb', line 68

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