Class: PlatinaWorld::Path
- Inherits:
-
Object
- Object
- PlatinaWorld::Path
- Defined in:
- lib/platina_world/path.rb
Instance Attribute Summary collapse
-
#file_path ⇒ Object
readonly
Returns the value of attribute file_path.
Instance Method Summary collapse
-
#directory? ⇒ True, False
Path is directory or not.
-
#directory_name ⇒ String
Directory path.
-
#file_name ⇒ String
File name.
-
#has_directory? ⇒ True, False
Path has directory path or not.
-
#initialize(file_path) ⇒ Path
constructor
A new instance of Path.
Constructor Details
#initialize(file_path) ⇒ Path
Returns a new instance of Path.
5 6 7 |
# File 'lib/platina_world/path.rb', line 5 def initialize(file_path) @file_path = file_path end |
Instance Attribute Details
#file_path ⇒ Object (readonly)
Returns the value of attribute file_path.
3 4 5 |
# File 'lib/platina_world/path.rb', line 3 def file_path @file_path end |
Instance Method Details
#directory? ⇒ True, False
Returns path is directory or not.
20 21 22 |
# File 'lib/platina_world/path.rb', line 20 def directory? file_name == "" end |
#directory_name ⇒ String
Returns directory path.
15 16 17 |
# File 'lib/platina_world/path.rb', line 15 def directory_name path[:directory] end |
#file_name ⇒ String
Returns file name.
10 11 12 |
# File 'lib/platina_world/path.rb', line 10 def file_name path[:file] end |
#has_directory? ⇒ True, False
Returns path has directory path or not.
25 26 27 |
# File 'lib/platina_world/path.rb', line 25 def has_directory? directory_name != "" end |