Class: ElFinder2::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/el_finder2.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.


26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/el_finder2.rb', line 26

def initialize
  @document_validations = {
    presence: true,
    file_type_ignorance: {}
  }
  @image_validations = {
    presence: true,
    content_type: { content_type: ElFinder2::IMAGE_MIME_REGEX }
  }

  @default_options = {}
  @image_options = {
    styles: { thumb: '100x100>' }
  }
  @document_options = {}
end

Instance Attribute Details

#default_optionsObject

Returns the value of attribute default_options.


24
25
26
# File 'lib/el_finder2.rb', line 24

def default_options
  @default_options
end

#document_optionsObject

Returns the value of attribute document_options.


22
23
24
# File 'lib/el_finder2.rb', line 22

def document_options
  @document_options
end

#document_validationsObject

Returns the value of attribute document_validations.


20
21
22
# File 'lib/el_finder2.rb', line 20

def document_validations
  @document_validations
end

#image_optionsObject

Returns the value of attribute image_options.


23
24
25
# File 'lib/el_finder2.rb', line 23

def image_options
  @image_options
end

#image_validationsObject

Returns the value of attribute image_validations.


21
22
23
# File 'lib/el_finder2.rb', line 21

def image_validations
  @image_validations
end

Instance Method Details

#document_attachmentObject


47
48
49
# File 'lib/el_finder2.rb', line 47

def document_attachment
  @default_options.merge(@document_options)
end

#image_attachmentObject


43
44
45
# File 'lib/el_finder2.rb', line 43

def image_attachment
  @default_options.merge(@image_options)
end