Class: Declare::BasicScope

Inherits:
Object
  • Object
show all
Defined in:
lib/declare/scope.rb

Direct Known Subclasses

AssertionsScope

Instance Method Summary collapse

Instance Method Details

#_declare_called_from(level = 0) ⇒ CallerEntry

Parameters:

  • level (Integer) (defaults to: 0)

Returns:



16
17
18
# File 'lib/declare/scope.rb', line 16

def _declare_called_from(level=0)
  CallerEntry.parse(caller[1 + level])
end

#The(target, &block) ⇒ AssertionsScope

Returns:



9
10
11
12
# File 'lib/declare/scope.rb', line 9

def The(target, &block)
  Declare.scope!(target, _declare_called_from)
  Declare.new_scope(target, &block)
end