Class: Alchemy::Custom::Model::ElFinder::Paths::Images

Inherits:
Base
  • Object
show all
Defined in:
lib/alchemy/custom/model/el_finder/paths/images.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)
[View source]

16
17
18
19
20
21
22
23
24
25
26
# File 'lib/alchemy/custom/model/el_finder/paths/images.rb', line 16

def build_file_path(p)

  base_class = Paths::Image

  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

[View source]

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

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