Class: Jdt::Referenced
- Inherits:
-
Object
- Object
- Jdt::Referenced
- Defined in:
- lib/jdt/manifest/referenced.rb
Instance Attribute Summary collapse
-
#extension_path ⇒ Object
Returns the value of attribute extension_path.
-
#parent_folder ⇒ Object
Returns the value of attribute parent_folder.
-
#path ⇒ Object
Returns the value of attribute path.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #exists? ⇒ Boolean
- #file? ⇒ Boolean
- #folder? ⇒ Boolean
- #path_in_extension ⇒ Object
- #path_in_filesystem ⇒ Object
- #to_s ⇒ Object
Instance Attribute Details
#extension_path ⇒ Object
Returns the value of attribute extension_path.
58 59 60 |
# File 'lib/jdt/manifest/referenced.rb', line 58 def extension_path @extension_path end |
#parent_folder ⇒ Object
Returns the value of attribute parent_folder.
58 59 60 |
# File 'lib/jdt/manifest/referenced.rb', line 58 def parent_folder @parent_folder end |
#path ⇒ Object
Returns the value of attribute path.
58 59 60 |
# File 'lib/jdt/manifest/referenced.rb', line 58 def path @path end |
#type ⇒ Object
Returns the value of attribute type.
58 59 60 |
# File 'lib/jdt/manifest/referenced.rb', line 58 def type @type end |
Instance Method Details
#exists? ⇒ Boolean
80 81 82 83 84 85 86 87 88 |
# File 'lib/jdt/manifest/referenced.rb', line 80 def exists? if (file?) File.exists?(path_in_filesystem) elsif (folder?) Dir.exists?(path_in_filesystem) else raise RuntimeError("Neither file nor folder.") end end |
#file? ⇒ Boolean
72 73 74 |
# File 'lib/jdt/manifest/referenced.rb', line 72 def file? type == :file end |
#folder? ⇒ Boolean
76 77 78 |
# File 'lib/jdt/manifest/referenced.rb', line 76 def folder? type == :folder end |
#path_in_extension ⇒ Object
64 65 66 67 68 69 70 |
# File 'lib/jdt/manifest/referenced.rb', line 64 def path_in_extension if (parent_folder and parent_folder != "") "#{parent_folder}/#{path}" else "#{path}" end end |
#path_in_filesystem ⇒ Object
60 61 62 |
# File 'lib/jdt/manifest/referenced.rb', line 60 def path_in_filesystem "#{extension_path}/#{path_in_extension}" end |
#to_s ⇒ Object
90 91 92 |
# File 'lib/jdt/manifest/referenced.rb', line 90 def to_s "Reference to #{type} #{path_in_extension}" end |