Class: Alchemy::Custom::Model::ElFinder::Paths::Files

Inherits:
Base
  • Object
show all
Defined in:
lib/alchemy/custom/model/el_finder/paths/files.rb

Instance Attribute Summary

Attributes inherited from Base

#path, #root, #volume

Instance Method Summary collapse

Methods inherited from Base

#absolute?, #basename, #basename_sans_extension, #child_directories, #cleanpath, #directory?, #dirname, #duplicate, #extname, #file?, #fisical_path, #full_fill_paylod, #fullpath, #global_id, #initialize, #is_image?, #is_root?, #mime_type, #mtime, #name, #outside_of_root?, #realpath, #relative?, #relative_to, #rename, #tmb, #to_s, #unique, #with_sub_dirs?

Constructor Details

This class inherits a constructor from Alchemy::Custom::Model::ElFinder::Paths::Base

Instance Method Details

#build_file_path(p) ⇒ Object



11
12
13
14
15
16
17
18
19
20
# File 'lib/alchemy/custom/model/el_finder/paths/files.rb', line 11

def build_file_path(p)
  base_class = Paths::File

  Rails.logger.debug {"#{@root}-#{self.path}"}
  image = base_class.new(@root, "#{self.path}/#{base_class.file_to_uri(p)}")

  image.active_record_instance = p

  image
end

#children(with_directory = true) ⇒ Object



5
6
7
8
9
# File 'lib/alchemy/custom/model/el_finder/paths/files.rb', line 5

def children(with_directory = true)
  ::Alchemy::Attachment.all.collect {|p|
    build_file_path(p)
  }
end