Class: FileProxy::Proxy
- Inherits:
-
Object
- Object
- FileProxy::Proxy
- Defined in:
- lib/file_proxy/proxy.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(scheme) ⇒ Proxy
constructor
A new instance of Proxy.
Constructor Details
#initialize(scheme) ⇒ Proxy
Returns a new instance of Proxy.
3 4 5 6 7 |
# File 'lib/file_proxy/proxy.rb', line 3 def initialize scheme self.class.instance_eval do include proxy_for scheme end end |
Class Method Details
.proxy_for(scheme) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/file_proxy/proxy.rb', line 9 def self.proxy_for scheme return Proxies::FileProxy if scheme.nil? proxy = scheme.dup proxy[0] = proxy[0].upcase Proxies.const_get "#{proxy}Proxy" end |