Class: Alchemy::Custom::Model::ElFinder::Paths::ComponentFiles

Inherits:
Base
  • Object
show all
Defined in:
lib/alchemy/custom/model/el_finder/paths/component_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

Costruisce il singolo file, passandogli l’active record di alchemy (Picture o Attachment)

Parameters:

  • p (Alchemy::Picture | Alchemy::Attachment)


20
21
22
23
24
25
26
27
28
29
30
# File 'lib/alchemy/custom/model/el_finder/paths/component_files.rb', line 20

def build_file_path(p)

  base_class = ComponentFile


  file_path = base_class.new(@root, "#{self.path}/#{base_class.file_to_uri(p)}", volume: self.volume)

  file_path.active_record_instance = p

  file_path
end

#children(with_directory = true) ⇒ Object



6
7
8
9
10
11
12
13
14
# File 'lib/alchemy/custom/model/el_finder/paths/component_files.rb', line 6

def children(with_directory = true)

  @volume.record.send(@volume.attribute).collect do |p|

    build_file_path(p)

  end

end