Class: Jdt::Referenced

Inherits:
Object
  • Object
show all
Defined in:
lib/jdt/manifest/referenced.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#extension_pathObject

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_folderObject

Returns the value of attribute parent_folder.



58
59
60
# File 'lib/jdt/manifest/referenced.rb', line 58

def parent_folder
  @parent_folder
end

#pathObject

Returns the value of attribute path.



58
59
60
# File 'lib/jdt/manifest/referenced.rb', line 58

def path
  @path
end

#typeObject

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

Returns:

  • (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

Returns:

  • (Boolean)


72
73
74
# File 'lib/jdt/manifest/referenced.rb', line 72

def file?
  type == :file
end

#folder?Boolean

Returns:

  • (Boolean)


76
77
78
# File 'lib/jdt/manifest/referenced.rb', line 76

def folder?
  type == :folder
end

#path_in_extensionObject



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_filesystemObject



60
61
62
# File 'lib/jdt/manifest/referenced.rb', line 60

def path_in_filesystem
  "#{extension_path}/#{path_in_extension}"
end

#to_sObject



90
91
92
# File 'lib/jdt/manifest/referenced.rb', line 90

def to_s
  "Reference to #{type} #{path_in_extension}"
end