Sha256: 70d8cb63367ab3d688f219b52f22a6e89b237b1bcc1f35cd47cd2300f5b45d91

Contents?: true

Size: 982 Bytes

Versions: 3

Compression:

Stored size: 982 Bytes

Contents

class EziiOsPath
  attr_accessor :global_path, :file_system # should stay for longer

  attr_accessor :dropbox_metainfo # should be refactored

  attr_accessor :https_url, :local_file_system_path, :complementary_local_file_system_paths # hacky

  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

  def file_system_path
    global_path.sub(/\/[^\/]+/, '')
  end

  def file_system_identifier
    global_path.match(/\/([^\/]+)/)[1]
  end

  def to_s
    file_system_path
  end

  def hacky_split_path(*args)
    to_s.split(*args)
  end

  def split(*args)
    hacky_split_path(*args)
  end

  def inspect
    global_path
  end

  def file?
    self.file_system.file?(self)
  end

  def modified_at
    self.file_system.path_modified_at(self)
  end

  # def https_url
  #   self.file_system.http_url(self)
  # end
end

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
jester-data-8.0.0 app/models/ezii_os_path.rb
ezii-os-5.2.1 app/models/ezii_os_path.rb
ezii-os-2.0.1 app/models/ezii_os_path.rb