Class: GitFame::FileUnit

Inherits:
Struct
  • Object
show all
Defined in:
lib/git_fame/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



2
3
4
# File 'lib/git_fame/file.rb', line 2

def path
  @path
end

Instance Method Details

#extnameObject



3
4
5
6
7
# File 'lib/git_fame/file.rb', line 3

def extname
  return @_extname if @_extname
  @_extname = ::File.extname(path).sub(/^\./, "")
  @_extname = @_extname.empty? ? "unknown" : @_extname
end

#to_sObject



9
10
11
# File 'lib/git_fame/file.rb', line 9

def to_s
  path
end