Class: Cms::Attachments::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/cms/attachments/configuration.rb

Overview

Allows each Attachment to have a customized configuration, even though there is a single Attachment class. Designed to allow 'typical' Paperclip configuration to be specified per attachment.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Set default configurations for Attachments.



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/cms/attachments/configuration.rb', line 47

def initialize
  self.url = ":attachment_file_path"
  self.path = ":attachments_root/:id_partition/:style/:fingerprint"
  self.styles = {}
  self.processors = [:thumbnail]
  self.default_url = "/:attachment/:style/missing.png"
  self.default_style = :original
  self.storage = :filesystem
  self.whiny = false

  @use_timestamp = false
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket



41
42
43
# File 'lib/cms/attachments/configuration.rb', line 41

def bucket
  @bucket
end

#default_styleObject

Returns the value of attribute default_style



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def default_style
  @default_style
end

#default_urlObject

Returns the value of attribute default_url



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def default_url
  @default_url
end

#file_permissionsObject

Returns the value of attribute file_permissions



42
43
44
# File 'lib/cms/attachments/configuration.rb', line 42

def file_permissions
  @file_permissions
end

#pathObject

Returns the value of attribute path



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def path
  @path
end

#processorsObject

Returns the value of attribute processors



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def processors
  @processors
end

#s3_credentialsObject

Returns the value of attribute s3_credentials



41
42
43
# File 'lib/cms/attachments/configuration.rb', line 41

def s3_credentials
  @s3_credentials
end

#storageObject

Returns the value of attribute storage



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def storage
  @storage
end

#stylesObject

Returns the value of attribute styles



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def styles
  @styles
end

#urlObject

Returns the value of attribute url



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def url
  @url
end

#use_timestampObject (readonly)

Returns the value of attribute use_timestamp



44
45
46
# File 'lib/cms/attachments/configuration.rb', line 44

def use_timestamp
  @use_timestamp
end

#whinyObject

Returns the value of attribute whiny



40
41
42
# File 'lib/cms/attachments/configuration.rb', line 40

def whiny
  @whiny
end