Class: JavaClass::Classpath::FileClasspath

Inherits:
Object
  • Object
show all
Defined in:
lib/javaclass/classpath/file_classpath.rb

Overview

Abstract concept of a classpath pointing to a file.

Author

Peter Kofler

Direct Known Subclasses

CompositeClasspath, FolderClasspath, JarClasspath

Instance Method Summary collapse

Constructor Details

#initialize(root) ⇒ FileClasspath

Create a classpath with this root .



11
12
13
# File 'lib/javaclass/classpath/file_classpath.rb', line 11

def initialize(root)
  @root = root
end

Instance Method Details

#==(other) ⇒ Object

Equality with other delegated to to_s.



30
31
32
# File 'lib/javaclass/classpath/file_classpath.rb', line 30

def ==(other)
  other.class == self.class && other.to_s == self.to_s
end

#additional_classpathObject

Return an empty array.



21
22
23
# File 'lib/javaclass/classpath/file_classpath.rb', line 21

def additional_classpath
  []
end

#elementsObject

Return the classpath elements of this (composite) classpath



35
36
37
# File 'lib/javaclass/classpath/file_classpath.rb', line 35

def elements
  [self]
end

#jar?Boolean

Return false as this is no jar.

Returns:

  • (Boolean)


16
17
18
# File 'lib/javaclass/classpath/file_classpath.rb', line 16

def jar?
  false
end

#to_key(classname) ⇒ Object

Return the key for the access of this class file named classname .



40
41
42
# File 'lib/javaclass/classpath/file_classpath.rb', line 40

def to_key(classname)
  classname.to_javaname.to_class_file
end

#to_sObject



25
26
27
# File 'lib/javaclass/classpath/file_classpath.rb', line 25

def to_s
  @root.to_s
end