Class: ReverseProxy::Config::Generic
- Inherits:
-
Object
- Object
- ReverseProxy::Config::Generic
- Includes:
- Logger
- Defined in:
- lib/reverse_proxy/config/generic.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#proxy ⇒ Object
readonly
Returns the value of attribute proxy.
Instance Method Summary collapse
-
#initialize(proxy) ⇒ Generic
constructor
A new instance of Generic.
- #prepare(type) ⇒ Object
Methods included from Logger
Constructor Details
#initialize(proxy) ⇒ Generic
Returns a new instance of Generic.
6 7 8 9 10 |
# File 'lib/reverse_proxy/config/generic.rb', line 6 def initialize proxy @proxy = proxy proxy.config = self @written = false end |
Instance Attribute Details
#proxy ⇒ Object (readonly)
Returns the value of attribute proxy.
5 6 7 |
# File 'lib/reverse_proxy/config/generic.rb', line 5 def proxy @proxy end |
Instance Method Details
#prepare(type) ⇒ Object
11 12 13 14 15 16 17 18 |
# File 'lib/reverse_proxy/config/generic.rb', line 11 def prepare type return unless block_given? result = yield name = result.to_s.strip mkdir name if type.to_s =~ /^dir/ touch name if type.to_s =~ /^file/ result end |