Class: EziiOsPath
- Inherits:
-
Object
- Object
- EziiOsPath
- Defined in:
- app/models/ezii_os_path.rb
Instance Attribute Summary collapse
-
#complementary_local_file_system_paths ⇒ Object
hacky.
-
#dropbox_metainfo ⇒ Object
should be refactored.
-
#file_system ⇒ Object
should stay for longer.
-
#global_path ⇒ Object
should stay for longer.
-
#https_url ⇒ Object
hacky.
-
#local_file_system_path ⇒ Object
hacky.
Instance Method Summary collapse
- #file? ⇒ Boolean
- #file_system_identifier ⇒ Object
- #file_system_path ⇒ Object
- #hacky_split_path(*args) ⇒ Object
-
#initialize(global_path) ⇒ EziiOsPath
constructor
A new instance of EziiOsPath.
- #inspect ⇒ Object
- #modified_at ⇒ Object
- #split(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(global_path) ⇒ EziiOsPath
Returns a new instance of EziiOsPath.
8 9 10 11 12 |
# File 'app/models/ezii_os_path.rb', line 8 def initialize(global_path) self.global_path = global_path self.file_system = FileSystem.find_by(machine_readable_identifier: file_system_identifier) self.complementary_local_file_system_paths = [] end |
Instance Attribute Details
#complementary_local_file_system_paths ⇒ Object
hacky
6 7 8 |
# File 'app/models/ezii_os_path.rb', line 6 def complementary_local_file_system_paths @complementary_local_file_system_paths end |
#dropbox_metainfo ⇒ Object
should be refactored
4 5 6 |
# File 'app/models/ezii_os_path.rb', line 4 def end |
#file_system ⇒ Object
should stay for longer
2 3 4 |
# File 'app/models/ezii_os_path.rb', line 2 def file_system @file_system end |
#global_path ⇒ Object
should stay for longer
2 3 4 |
# File 'app/models/ezii_os_path.rb', line 2 def global_path @global_path end |
#https_url ⇒ Object
hacky
6 7 8 |
# File 'app/models/ezii_os_path.rb', line 6 def https_url @https_url end |
#local_file_system_path ⇒ Object
hacky
6 7 8 |
# File 'app/models/ezii_os_path.rb', line 6 def local_file_system_path @local_file_system_path end |
Instance Method Details
#file? ⇒ Boolean
38 39 40 |
# File 'app/models/ezii_os_path.rb', line 38 def file? self.file_system.file?(self) end |
#file_system_identifier ⇒ Object
18 19 20 |
# File 'app/models/ezii_os_path.rb', line 18 def file_system_identifier global_path.match(/\/([^\/]+)/)[1] end |
#file_system_path ⇒ Object
14 15 16 |
# File 'app/models/ezii_os_path.rb', line 14 def file_system_path global_path.sub(/\/[^\/]+/, '') end |
#hacky_split_path(*args) ⇒ Object
26 27 28 |
# File 'app/models/ezii_os_path.rb', line 26 def hacky_split_path(*args) to_s.split(*args) end |
#inspect ⇒ Object
34 35 36 |
# File 'app/models/ezii_os_path.rb', line 34 def inspect global_path end |
#modified_at ⇒ Object
42 43 44 |
# File 'app/models/ezii_os_path.rb', line 42 def modified_at self.file_system.path_modified_at(self) end |
#split(*args) ⇒ Object
30 31 32 |
# File 'app/models/ezii_os_path.rb', line 30 def split(*args) hacky_split_path(*args) end |
#to_s ⇒ Object
22 23 24 |
# File 'app/models/ezii_os_path.rb', line 22 def to_s file_system_path end |