Ask Your Question

require dependency on siblings

asked 2016-02-18 07:24:35 -0600

From reading it was my understanding that in the following case, bar would require foo, and that bar would be enacted before foo.

class blah { require foo include bar }

Can anyone help with what I'm missing here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-02-18 15:50:56 -0600

lavaman gravatar image

With what you have, anything in class foo would be applied before anything further down in class blah and things in class bar would get applied at some point, though not in any particular order.

edit flag offensive delete link more


So - from what I understand here "anything further down in class blah" would include bar, so everything in foo should be applied before anything in bar? This isn't what I'm seeing take place.

rorybrowne gravatar imagerorybrowne ( 2016-02-19 06:04:56 -0600 )edit

No, include bar means "make sure the resources in class bar are included in the catalog somewhere." Require foo only orders the resources in foo relative to *resources* in class blah, not any other class includes because those resources belong to a different class.

lavaman gravatar imagelavaman ( 2016-02-19 12:27:39 -0600 )edit

What you have to understand about classes is that they are merely tags on resources, so when you require foo, you're saying "Apply all resources tagged foo before any resources tagged blah." Including bar does not order resources tagged bar with respect to either foo or blah resources.

lavaman gravatar imagelavaman ( 2016-02-19 12:31:07 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2016-02-18 07:24:35 -0600

Seen: 39 times

Last updated: Feb 18 '16