Class: Thumbor::Cascade
- Inherits:
-
Object
- Object
- Thumbor::Cascade
- Extended by:
- Forwardable
- Defined in:
- lib/thumbor/cascade.rb
Instance Attribute Summary collapse
-
#filters ⇒ Object
Returns the value of attribute filters.
-
#image ⇒ Object
Returns the value of attribute image.
-
#old_crypto ⇒ Object
Returns the value of attribute old_crypto.
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
- #generate ⇒ Object
-
#initialize(image = nil) ⇒ Cascade
constructor
A new instance of Cascade.
- #method_missing(m, *args) ⇒ Object
- #url_for ⇒ Object
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args) ⇒ Object
40 41 42 43 44 45 46 47 |
# File 'lib/thumbor/cascade.rb', line 40 def method_missing(m, *args) if /^(.+)_filter$/.match(m.to_s) @filters << "#{$1}(#{escape_args(args).join(',')})" self else super end end |
Instance Attribute Details
#filters ⇒ Object
Returns the value of attribute filters.
9 10 11 |
# File 'lib/thumbor/cascade.rb', line 9 def filters @filters end |
#image ⇒ Object
Returns the value of attribute image.
9 10 11 |
# File 'lib/thumbor/cascade.rb', line 9 def image @image end |
#old_crypto ⇒ Object
Returns the value of attribute old_crypto.
9 10 11 |
# File 'lib/thumbor/cascade.rb', line 9 def old_crypto @old_crypto end |
#options ⇒ Object
Returns the value of attribute options.
9 10 11 |
# File 'lib/thumbor/cascade.rb', line 9 def @options end |
Instance Method Details
#generate ⇒ Object
36 37 38 |
# File 'lib/thumbor/cascade.rb', line 36 def generate @old_crypto.generate (@options).merge({:image => @image, :filters => @filters}) end |
#url_for ⇒ Object
32 33 34 |
# File 'lib/thumbor/cascade.rb', line 32 def url_for @old_crypto.url_for (@options).merge({:image => @image, :filters => @filters}) end |