Class: PlatinaWorld::Path

Inherits:
Object
  • Object
show all
Defined in:
lib/platina_world/path.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_pathObject (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.

Returns:

  • (True, False)

    path is directory or not



20
21
22
# File 'lib/platina_world/path.rb', line 20

def directory?
  file_name == ""
end

#directory_nameString

Returns directory path.

Returns:

  • (String)

    directory path



15
16
17
# File 'lib/platina_world/path.rb', line 15

def directory_name
  path[:directory]
end

#file_nameString

Returns file name.

Returns:

  • (String)

    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.

Returns:

  • (True, False)

    path has directory path or not



25
26
27
# File 'lib/platina_world/path.rb', line 25

def has_directory?
  directory_name != ""
end