Module: Declare::ObjectExtension

Included in:
Object
Defined in:
lib/declare/object_extension.rb

Instance Method Summary collapse

Instance Method Details

#_declare_called_from(level = 0) ⇒ CallerEntry (private)

Parameters:

  • level (Integer) (defaults to: 0)

Returns:


19
20
21
# File 'lib/declare/object_extension.rb', line 19

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

#The(target, &block) ⇒ Scope (private)

Returns:


10
11
12
13
# File 'lib/declare/object_extension.rb', line 10

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