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.



25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/el_finder2.rb', line 25

def initialize
  @document_validations = {
    presence: true,
    file_type_ignorance: {}
  }
  @image_styles = { thumb: '100x100>' }
  @image_validations = {
    presence: true,
    content_type: { content_type: ElFinder2::IMAGE_MIME_REGEX }
  }
  @paperclip_defaults = {}
end

Instance Attribute Details

#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_stylesObject

Returns the value of attribute image_styles.



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

def image_styles
  @image_styles
end

#image_validationsObject

Returns the value of attribute image_validations.



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

def image_validations
  @image_validations
end

#paperclip_defaultsObject

Returns the value of attribute paperclip_defaults.



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

def paperclip_defaults
  @paperclip_defaults
end

Instance Method Details

#document_attachmentObject



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

def document_attachment
  @paperclip_defaults
end

#image_attachmentObject



38
39
40
# File 'lib/el_finder2.rb', line 38

def image_attachment
  @paperclip_defaults.merge(styles: @image_styles)
end