Class: Cheese::Nginx::VirtualHost
- Inherits:
-
Object
- Object
- Cheese::Nginx::VirtualHost
- Defined in:
- lib/web/virtual_host.rb
Overview
Represents a vhost in an nginx config file
Constant Summary collapse
- DELEGATED_METHODS =
[:remove]
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
Instance Method Summary collapse
-
#initialize(domain, config) ⇒ VirtualHost
constructor
A new instance of VirtualHost.
- #method_missing(meth, *args, &block) ⇒ Object
Constructor Details
#initialize(domain, config) ⇒ VirtualHost
Returns a new instance of VirtualHost.
11 12 13 |
# File 'lib/web/virtual_host.rb', line 11 def initialize(domain, config) @domain, @config = domain, config end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &block) ⇒ Object
15 16 17 18 19 |
# File 'lib/web/virtual_host.rb', line 15 def method_missing(meth, *args, &block) if DELEGATED_METHODS.include? meth @config.send(meth, self) end end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
7 8 9 |
# File 'lib/web/virtual_host.rb', line 7 def config @config end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
7 8 9 |
# File 'lib/web/virtual_host.rb', line 7 def domain @domain end |