Class: Cms::Attachments::Configuration
- Inherits:
-
Object
- Object
- Cms::Attachments::Configuration
- 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
-
#bucket ⇒ Object
Returns the value of attribute bucket.
-
#default_style ⇒ Object
Returns the value of attribute default_style.
-
#default_url ⇒ Object
Returns the value of attribute default_url.
-
#file_permissions ⇒ Object
Returns the value of attribute file_permissions.
-
#path ⇒ Object
Returns the value of attribute path.
-
#processors ⇒ Object
Returns the value of attribute processors.
-
#s3_credentials ⇒ Object
Returns the value of attribute s3_credentials.
-
#storage ⇒ Object
Returns the value of attribute storage.
-
#styles ⇒ Object
Returns the value of attribute styles.
-
#url ⇒ Object
Returns the value of attribute url.
-
#use_timestamp ⇒ Object
readonly
Returns the value of attribute use_timestamp.
-
#whiny ⇒ Object
Returns the value of attribute whiny.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
Set default configurations for Attachments.
Constructor Details
#initialize ⇒ Configuration
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
#bucket ⇒ Object
Returns the value of attribute bucket.
41 42 43 |
# File 'lib/cms/attachments/configuration.rb', line 41 def bucket @bucket end |
#default_style ⇒ Object
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_url ⇒ Object
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_permissions ⇒ Object
Returns the value of attribute file_permissions.
42 43 44 |
# File 'lib/cms/attachments/configuration.rb', line 42 def @file_permissions end |
#path ⇒ Object
Returns the value of attribute path.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def path @path end |
#processors ⇒ Object
Returns the value of attribute processors.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def processors @processors end |
#s3_credentials ⇒ Object
Returns the value of attribute s3_credentials.
41 42 43 |
# File 'lib/cms/attachments/configuration.rb', line 41 def s3_credentials @s3_credentials end |
#storage ⇒ Object
Returns the value of attribute storage.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def storage @storage end |
#styles ⇒ Object
Returns the value of attribute styles.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def styles @styles end |
#url ⇒ Object
Returns the value of attribute url.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def url @url end |
#use_timestamp ⇒ Object (readonly)
Returns the value of attribute use_timestamp.
44 45 46 |
# File 'lib/cms/attachments/configuration.rb', line 44 def @use_timestamp end |
#whiny ⇒ Object
Returns the value of attribute whiny.
40 41 42 |
# File 'lib/cms/attachments/configuration.rb', line 40 def whiny @whiny end |