Class: PaperclipCompression::Config
- Inherits:
-
Object
- Object
- PaperclipCompression::Config
- Defined in:
- lib/paperclip-compression/config.rb
Constant Summary collapse
- PROCESSOR_OPTIONS_KEY =
:processor_options
- KEY =
:compression
Class Method Summary collapse
Instance Method Summary collapse
- #command ⇒ Object
-
#initialize(options, type_key, fallback, whiny) ⇒ Config
constructor
A new instance of Config.
- #options ⇒ Object
- #process_file? ⇒ Boolean
- #whiny ⇒ Object
Constructor Details
permalink #initialize(options, type_key, fallback, whiny) ⇒ Config
Returns a new instance of Config.
13 14 15 16 17 |
# File 'lib/paperclip-compression/config.rb', line 13 def initialize(, type_key, fallback, whiny) @whiny = whiny @fallback = fallback (, type_key) end |
Class Method Details
permalink .create_with_fallbacks(style_options, type_key, gem_defaults) ⇒ Object
[View source]
7 8 9 10 11 |
# File 'lib/paperclip-compression/config.rb', line 7 def self.create_with_fallbacks(, type_key, gem_defaults) gem_config = new({ KEY => { type_key => gem_defaults } }, type_key, nil, nil) defaults_config = new(Paperclip::Attachment., type_key, gem_config, Paperclip::Attachment.[:whiny]) new([PROCESSOR_OPTIONS_KEY], type_key, defaults_config, [:whiny]) end |
Instance Method Details
permalink #command ⇒ Object
[View source]
29 30 31 32 33 34 35 36 37 |
# File 'lib/paperclip-compression/config.rb', line 29 def command if defined?(@command) @command elsif @fallback @fallback.command else raise("options or fallback should have 'command'") end end |
permalink #options ⇒ Object
[View source]
39 40 41 42 43 44 45 46 47 |
# File 'lib/paperclip-compression/config.rb', line 39 def if defined?(@options) @options elsif @fallback @fallback. else raise("options or fallback should have 'options'") end end |
permalink #process_file? ⇒ Boolean
19 20 21 22 23 24 25 26 27 |
# File 'lib/paperclip-compression/config.rb', line 19 def process_file? if defined?(@process_file) @process_file elsif @fallback @fallback.process_file? else raise('options or fallback should have attributes') end end |
permalink #whiny ⇒ Object
[View source]
49 50 51 |
# File 'lib/paperclip-compression/config.rb', line 49 def whiny @whiny end |