Class: Medusa::Node

Inherits:
Object
  • Object
show all
Defined in:
lib/medusa/node.rb

Overview

Abstract base class for File and Directory.

Direct Known Subclasses

Directory, File

Instance Method Summary collapse

Constructor Details

#initializeNode

Returns a new instance of Node.



8
9
10
# File 'lib/medusa/node.rb', line 8

def initialize
  @id = @uuid = nil
end

Instance Method Details

#loadObject



27
28
29
# File 'lib/medusa/node.rb', line 27

def load
  raise 'Subclasses must implement load()'
end

#nameString

Returns Last path component of #relative_key.

Returns:



15
16
17
# File 'lib/medusa/node.rb', line 15

def name
  ::File.basename(self.relative_key)
end

#relative_keyString

Returns:

  • (String)


22
23
24
25
# File 'lib/medusa/node.rb', line 22

def relative_key
  load
  @relative_key
end