Module: Dependor::Sinatra::WithoutDependor

Included in:
Sinatra::Base
Defined in:
lib/dependor-sinatra/without_dependor.rb

Instance Method Summary collapse

Instance Method Details

#dependor_disabled?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/dependor-sinatra/without_dependor.rb', line 12

def dependor_disabled?
  @dependor_disabled
end

#disable_dependorObject



4
5
6
# File 'lib/dependor-sinatra/without_dependor.rb', line 4

def disable_dependor
  @dependor_disabled = true
end

#enable_dependorObject



8
9
10
# File 'lib/dependor-sinatra/without_dependor.rb', line 8

def enable_dependor
  @dependor_disabled = false
end

#without_dependor(&block) ⇒ Object



16
17
18
19
20
# File 'lib/dependor-sinatra/without_dependor.rb', line 16

def without_dependor(&block)
  disable_dependor
  block.call
  enable_dependor
end