Class: Cheese::Nginx::VirtualHost

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#configObject (readonly)

Returns the value of attribute config.



7
8
9
# File 'lib/web/virtual_host.rb', line 7

def config
  @config
end

#domainObject (readonly)

Returns the value of attribute domain.



7
8
9
# File 'lib/web/virtual_host.rb', line 7

def domain
  @domain
end