Class: CaDOVe::Java::JavaSourceTree
- Inherits:
-
Object
- Object
- CaDOVe::Java::JavaSourceTree
- Defined in:
- lib/cadove/models/java/code.rb
Instance Method Summary collapse
- #classes ⇒ Object
- #hashify ⇒ Object
-
#initialize(directory) ⇒ JavaSourceTree
constructor
A new instance of JavaSourceTree.
Constructor Details
#initialize(directory) ⇒ JavaSourceTree
Returns a new instance of JavaSourceTree.
9 10 11 12 13 14 15 16 17 |
# File 'lib/cadove/models/java/code.rb', line 9 def initialize(directory) file = Rjb::import('java.io.File'). new_with_sig('Ljava.lang.String;', directory) builder = Rjb::import('com.thoughtworks.qdox.JavaDocBuilder').new builder._invoke('addSourceTree', 'Ljava.io.File;', file) @sources = builder.getSources end |
Instance Method Details
#classes ⇒ Object
19 20 21 |
# File 'lib/cadove/models/java/code.rb', line 19 def classes JavaClass.all(@sources) end |
#hashify ⇒ Object
23 24 25 26 27 28 29 |
# File 'lib/cadove/models/java/code.rb', line 23 def hashify all = {} classes.each do |clazz| all.merge!(clazz.hashify) end all end |