Class: Copper::DataTypes::FilenameClass

Inherits:
Object
  • Object
show all
Defined in:
lib/copper/data_types/filename.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(filename) ⇒ FilenameClass

Returns a new instance of FilenameClass.



40
41
42
43
44
45
# File 'lib/copper/data_types/filename.rb', line 40

def initialize(filename)
	@expanded_path = File.expand_path(filename)
	@ext = File.extname(filename)
	@name = File.basename(filename, @ext)
	@path = File.dirname(filename)
end

Instance Attribute Details

#expanded_pathObject

Returns the value of attribute expanded_path.



38
39
40
# File 'lib/copper/data_types/filename.rb', line 38

def expanded_path
  @expanded_path
end

#extObject

Returns the value of attribute ext.



35
36
37
# File 'lib/copper/data_types/filename.rb', line 35

def ext
  @ext
end

#nameObject

Returns the value of attribute name.



36
37
38
# File 'lib/copper/data_types/filename.rb', line 36

def name
  @name
end

#pathObject

Returns the value of attribute path.



37
38
39
# File 'lib/copper/data_types/filename.rb', line 37

def path
  @path
end

Instance Method Details

#to_sObject



47
48
49
# File 'lib/copper/data_types/filename.rb', line 47

def to_s
	"path:#{@paht}, name:#{@name}, ext:#{@ext}"
end