contentNode.isInline() or .isBlock() throw a NotImplementedError

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

contentNode.isInline() or .isBlock() throw a NotImplementedError

Jeremie Bresson
While I am working on the asciidoctor(j) AST; I have noticed that I get a NotImplementedError when I call isInline() or isBlock() on a contentNode.

I do not understand ruby code, but this exception seems to be hardcoded. In abstract_node.rb (v1.5.6.1):
* def inline?
* def bloc?

Can someone provide some inside on those two methods? Is this a work-in-progress feature? Is there any case, where those methods are implemented (maybe in a subclass of ContentNode)? I could not find anything, but again my ruby knowledge is very limited.

Thank you in advance.

Reply | Threaded
Open this post in threaded view
|

Re: contentNode.isInline() or .isBlock() throw a NotImplementedError

mojavelinux
Administrator
These methods are implemented in the subclasses. They are part of what makes the AbstractNode abstract.

If ContentNode is not an abstract class, then we'll need to map it to a concrete Ruby class. However, I'm not sure what the use case is for instantiating ContentNode directly. Shouldn't you be instantiating a real node type?

Perhaps we should mark ContentNode as abstract too.

-Dan

On Sun, Nov 26, 2017 at 10:36 PM, Jeremie Bresson [via Asciidoctor :: Discussion] <[hidden email]> wrote:
While I am working on the asciidoctor(j) AST; I have noticed that I get a NotImplementedError when I call isInline() or isBlock() on a contentNode.

I do not understand ruby code, but this exception seems to be hardcoded. In abstract_node.rb (v1.5.6.1):
* def inline?
*
def bloc?


Can someone provide some inside on those two methods? Is this a work-in-progress feature? Is there any case, where those methods are implemented (maybe in a subclass of ContentNode)? I could not find anything, but again my ruby knowledge is very limited.

Thank you in advance.




If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/contentNode-isInline-or-isBlock-throw-a-NotImplementedError-tp6035.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: contentNode.isInline() or .isBlock() throw a NotImplementedError

Jeremie Bresson
Thank you for your answer.

I did some additional tests and found two other node types where the methods are not implemented:

* column (java class ColumnImpl)
* cell (java class CellImpl)

It might be more.