Class: Shrine::Storage::Cloudinary::Delegator
- Inherits:
-
Object
- Object
- Shrine::Storage::Cloudinary::Delegator
- Defined in:
- lib/shrine/storage/cloudinary.rb
Overview
Delegates each method call to the specified klass, but passing specified default options.
Instance Method Summary collapse
-
#initialize(klass, default_options) ⇒ Delegator
constructor
A new instance of Delegator.
- #method_missing(name, *args, **options, &block) ⇒ Object
- #respond_to_missing?(name, include_private = false) ⇒ Boolean
Constructor Details
#initialize(klass, default_options) ⇒ Delegator
Returns a new instance of Delegator.
175 176 177 178 |
# File 'lib/shrine/storage/cloudinary.rb', line 175 def initialize(klass, ) @klass = klass @default_options = end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, **options, &block) ⇒ Object
180 181 182 |
# File 'lib/shrine/storage/cloudinary.rb', line 180 def method_missing(name, *args, **, &block) @klass.public_send(name, *args, **@default_options, **, &block) end |
Instance Method Details
#respond_to_missing?(name, include_private = false) ⇒ Boolean
184 185 186 |
# File 'lib/shrine/storage/cloudinary.rb', line 184 def respond_to_missing?(name, include_private = false) @klass.respond_to?(name, include_private) end |