You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This looks like a bug to me, but I don't know enough about how inheritance is implemented to understand it fully. I have a workaround for now, but it should be better understood, documented, and maybe fixed if it's actually a problem.
classFooincludeOM::XML::Documentset_terminologydo |t|
t.root(:path=>"foo")t.bart.barbaz(:ref=>[:bar],:attributes=>{:type=>"baz"})endendFoo.terminology.xpath_for:bar# should be //barFoo.terminology.xpath_for:barbaz# should be //bar[@type="baz"]classFooBar < Fooextend_terminologydo |t|
t.barquux(:ref=>[:bar],:attributes=>{:type=>"quux"})endendFooBar.terminology.xpath_for:bar# should be //barFooBar.terminology.xpath_for:barbaz# should be //bar[@type="baz"]FooBar.terminology.xpath_for:barquux# should be //bar[@type="quux"]classFooBaz < Fooextend_terminologydo |t|
t.bazt.bazquux(:ref=>[:baz],:attributes=>{:type=>"quux"})endendFooBaz.terminology.xpath_for:bar# should be //barFooBaz.terminology.xpath_for:barbaz# should be //bar[@type="baz"]FooBaz.terminology.xpath_for:baz# should be //bazFooBaz.terminology.xpath_for:bazquux# should be //baz[@type="quux"]# Workaround: Define FooBar and FooBaz again, but withincludeOM::XML::Documentuse_terminology(Foo)# before the extend_terminology block
The text was updated successfully, but these errors were encountered:
Expected behavior:FooBar and FooBaz have full access to Foo's terminology, and can extend it, since they inherit from the class directly.
Observed behavior:FooBar and FooBaz have no knowledge of Foo's terms, but can define their own, even without including OM::XML::Document explicitly. However, they cannot refer to anything in Foo's terminology in their definitions.
This looks like a bug to me, but I don't know enough about how inheritance is implemented to understand it fully. I have a workaround for now, but it should be better understood, documented, and maybe fixed if it's actually a problem.
The text was updated successfully, but these errors were encountered: