Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to signal "not implemented yet"?

In the initial drafting of a new gem I need to leave some method implementations empty ( to be implemented in the next )

Therefore, I would like to signal a "not implemented yet" exception

I'm wondering if there is a best practice or standard conventions specific to the Ruby language to code this kind of placeholder / exception.

i.e: something like:

  • UnsupportedOperationException in Java
  • NotImplementedException in .Net Framework (C#)
like image 665
Franco Rondini Avatar asked Dec 02 '12 09:12

Franco Rondini


2 Answers

You should raise NotImplementedError

raise NotImplementedError 

ruby-doc

like image 124
pasha.zhukov Avatar answered Sep 20 '22 04:09

pasha.zhukov


You may use the todonotes-gem

There is a documentation with some examples.

It doesn't implement an exception, but a logging mechanism and a possibility for temporary solutions.

like image 37
knut Avatar answered Sep 19 '22 04:09

knut