Module: AbstractInterface::Methods

Defined in:
lib/ci_toolkit/dvcs_pr.rb

Overview

Use this to enforce that implementing class do implemented the needed contract

Instance Method Summary collapse

Instance Method Details

#api_not_implemented(klass, method_name = nil) ⇒ Object



16
17
18
19
20
21
22
23
# File 'lib/ci_toolkit/dvcs_pr.rb', line 16

def api_not_implemented(klass, method_name = nil)
  if method_name.nil?
    caller.first.match(/in `(.+)'/)
    method_name = Regexp.last_match(1)
  end
  raise AbstractInterface::InterfaceNotImplementedError,
        "#{klass.class.name} needs to implement '#{method_name}' for interface #{name}!"
end