1

I have a ruby project with a module and a class defined in the module:

  • a.rb
  • a/b.rb

File a.rb contains:

require 'a/b'
module A
end

File a/b.rb contains:

module A
  class B
  end
end

When I run yardoc ** and then yard graph --full --dependencies | dot -T pdf -o doc/diagram.pdf, the resulting pdf contains class B, which is outside of module A.

However, in HTML files generated by yardoc the class B is correctly placed inside the module A.

Diagram How can I configure Yard such that the class B will be placed inside the module A?

mirelon
  • 4,896
  • 6
  • 40
  • 70
  • There is no relationship between class `B` and module `A`. Ruby doesn't have nested classes like Beta or Newspeak. The *constant* `B` lives inside the namespace of module `A`, but the class *itself* which is referenced by that constant has no relationship to module `A`. The only relationship that classes have in Ruby, is to their superclass. So, the diagram is entirely correct. – Jörg W Mittag Oct 14 '14 at 12:02

0 Answers0