Module: Copyable::DeclarationStubber

Included in:
CompletenessChecker
Defined in:
lib/copyable/syntax_checking/declaration_stubber.rb

Class Method Summary collapse

Class Method Details

.included(klass) ⇒ Object

This creates dummy methods for each declaration, which is useful if you are creating a class that merely wants to check that a particular declaration is called correctly. It’s useful to have the other declarations that you don’t care about available as stubs.



9
10
11
12
13
14
15
# File 'lib/copyable/syntax_checking/declaration_stubber.rb', line 9

def self.included(klass)
  Declarations::ALL.each do |decl|
    klass.send(:define_method, decl.method_name) do |*args|
      # intentionally empty
    end
  end
end