Class: Copper::DataTypes::FilenameClass
- Inherits:
-
Object
- Object
- Copper::DataTypes::FilenameClass
- Defined in:
- lib/copper/data_types/filename.rb
Instance Attribute Summary collapse
-
#expanded_path ⇒ Object
Returns the value of attribute expanded_path.
-
#ext ⇒ Object
Returns the value of attribute ext.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(filename) ⇒ FilenameClass
constructor
A new instance of FilenameClass.
- #to_s ⇒ Object
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.(filename) @ext = File.extname(filename) @name = File.basename(filename, @ext) @path = File.dirname(filename) end |
Instance Attribute Details
#expanded_path ⇒ Object
Returns the value of attribute expanded_path.
38 39 40 |
# File 'lib/copper/data_types/filename.rb', line 38 def @expanded_path end |
#ext ⇒ Object
Returns the value of attribute ext.
35 36 37 |
# File 'lib/copper/data_types/filename.rb', line 35 def ext @ext end |
#name ⇒ Object
Returns the value of attribute name.
36 37 38 |
# File 'lib/copper/data_types/filename.rb', line 36 def name @name end |
#path ⇒ Object
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_s ⇒ Object
47 48 49 |
# File 'lib/copper/data_types/filename.rb', line 47 def to_s "path:#{@paht}, name:#{@name}, ext:#{@ext}" end |