Class: DuckTyper::InterfaceChecker
- Inherits:
-
Object
- Object
- DuckTyper::InterfaceChecker
- Defined in:
- lib/duck_typer/interface_checker.rb,
lib/duck_typer/interface_checker/result.rb
Overview
Compares the public method signatures of two classes and reports mismatches.
Defined Under Namespace
Classes: Result
Instance Method Summary collapse
- #call(left, right) ⇒ Object
-
#initialize(type: :instance_methods, methods: nil, strict: false, name: nil) ⇒ InterfaceChecker
constructor
A new instance of InterfaceChecker.
Constructor Details
#initialize(type: :instance_methods, methods: nil, strict: false, name: nil) ⇒ InterfaceChecker
Returns a new instance of InterfaceChecker.
10 11 12 13 14 15 16 |
# File 'lib/duck_typer/interface_checker.rb', line 10 def initialize(type: :instance_methods, methods: nil, strict: false, name: nil) @type = type @methods = methods @strict = strict @name = name @inspectors = Hash.new { |h, k| h[k] = MethodInspector.for(k, @type) } end |