Module: Contractual::Interface::Methods
- Defined in:
- lib/contractual.rb
Instance Method Summary collapse
Instance Method Details
#does_not_implement_method(klass, method_name = nil) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/contractual.rb', line 14 def does_not_implement_method(klass, method_name = nil) if method_name.nil? caller.first.match(/in \`(.+)\'/) method_name = $1 end klass_name = klass.class.name interface_name = self.name raise MethodNotImplementedError.new("#{klass.class.name} is obligated to implement '#{method_name}' for interface #{self.name}!") end |