Class: FileStore::Instance
- Inherits:
-
Object
- Object
- FileStore::Instance
show all
- Defined in:
- lib/file_store/instance.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
19
20
21
22
23
24
25
26
|
# File 'lib/file_store/instance.rb', line 19
def method_missing(meth, *args, &block)
if provider.respond_to?(meth)
meth = provider.mocked? ? "mock_#{meth}" : meth
provider.public_send(meth, *args, &block)
else
super
end
end
|
Instance Method Details
#config ⇒ Object
3
4
5
|
# File 'lib/file_store/instance.rb', line 3
def config
(@__config ||= Config.new).tap { |config| yield config if block_given? }
end
|
#provider ⇒ Object
7
8
9
10
11
|
# File 'lib/file_store/instance.rb', line 7
def provider
@__provider ||= Providers::S3.new(config.to_h)
end
|