Module: GollumRails::Upload::ClassDefinitions::ClassMethods

Defined in:
lib/gollum_rails/upload/class_definitions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blacklistObject

Returns the value of attribute blacklist


10
11
12
# File 'lib/gollum_rails/upload/class_definitions.rb', line 10

def blacklist
  @blacklist
end

#destinationObject

Returns the value of attribute destination


8
9
10
# File 'lib/gollum_rails/upload/class_definitions.rb', line 8

def destination
  @destination
end

#overwriteObject

Returns the value of attribute overwrite


9
10
11
# File 'lib/gollum_rails/upload/class_definitions.rb', line 9

def overwrite
  @overwrite
end

#whitelistObject

Returns the value of attribute whitelist


11
12
13
# File 'lib/gollum_rails/upload/class_definitions.rb', line 11

def whitelist
  @whitelist
end

Instance Method Details

#blacklist_format(*formats) ⇒ Object


12
13
14
15
# File 'lib/gollum_rails/upload/class_definitions.rb', line 12

def blacklist_format(*formats)
  self.blacklist ||= []
  self.blacklist += Array(formats)
end

#max_filesize(size) ⇒ Object


20
21
22
# File 'lib/gollum_rails/upload/class_definitions.rb', line 20

def max_filesize(size)
  @max_size=size if size
end

#max_sizeObject


23
24
25
# File 'lib/gollum_rails/upload/class_definitions.rb', line 23

def max_size
  @max_size
end

#overwrite_existing_files(bool) ⇒ Object


29
30
31
# File 'lib/gollum_rails/upload/class_definitions.rb', line 29

def overwrite_existing_files(bool)
  self.overwrite = bool
end

#upload_directory(dir) ⇒ Object


26
27
28
# File 'lib/gollum_rails/upload/class_definitions.rb', line 26

def upload_directory(dir)
  self.destination = dir
end

#whitelist_format(*formats) ⇒ Object


16
17
18
19
# File 'lib/gollum_rails/upload/class_definitions.rb', line 16

def whitelist_format(*formats)
  self.whitelist ||= []
  self.whitelist += Array(formats)
end