Module: ActiveMocker::MockCreator::SafeMethods

Included in:
DefinedMethods, Scopes
Defined in:
lib/active_mocker/mock_creator/safe_methods.rb

Defined Under Namespace

Modules: ActiveMocker

Constant Summary collapse

BASE =
{ instance_methods: [], scopes: [], methods: [] }.freeze

Instance Method Summary collapse

Instance Method Details

#safe_methodsObject



7
8
9
10
11
12
13
14
15
# File 'lib/active_mocker/mock_creator/safe_methods.rb', line 7

def safe_methods
  @safe_methods ||= class_introspector.parsed_source.comments.each_with_object(BASE.dup) do |comment, hash|
    if comment.text.include?("ActiveMocker.safe_methods")
      hash.merge!(ActiveMocker.module_eval(comment.text.delete("#")))
    else
      hash
    end
  end
end