Class: DirTravel::FileEntry

Inherits:
Entry
  • Object
show all
Defined in:
lib/dirtravel.rb

Overview

File type entry.

Instance Attribute Summary collapse

Attributes inherited from Entry

#name

Instance Method Summary collapse

Methods inherited from Entry

#abspath, #dir, #files, #parts, #path, #relative?, #rename, #select_level, #stat, #subpath, #tip

Constructor Details

#initialize(name) ⇒ FileEntry

Set name, suffix, and basename.

Parameters:

  • name (String)

    File name.



191
192
193
194
195
# File 'lib/dirtravel.rb', line 191

def initialize( name )
    super( name )
    @suffix = File.extname( name )
    @basename = File.basename( name, @suffix )
end

Instance Attribute Details

#basenameObject (readonly)

Returns the value of attribute basename.



186
187
188
# File 'lib/dirtravel.rb', line 186

def basename
  @basename
end

#suffixObject (readonly)

Returns the value of attribute suffix.



186
187
188
# File 'lib/dirtravel.rb', line 186

def suffix
  @suffix
end