Class: Cheese::Nginx::Proxy

Inherits:
Object
  • Object
show all
Defined in:
lib/web/proxy.rb

Overview

Represents the proxies to external processes that a vhost requires

Constant Summary collapse

DELEGATED_METHODS =
[:remove]

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(domain, ports, config) ⇒ Proxy

Returns a new instance of Proxy.



11
12
13
14
# File 'lib/web/proxy.rb', line 11

def initialize(domain, ports, config)
  @domain, @ports = domain, ports.to_a
  @config = config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



16
17
18
19
20
# File 'lib/web/proxy.rb', line 16

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/proxy.rb', line 7

def config
  @config
end

#domainObject (readonly)

Returns the value of attribute domain.



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

def domain
  @domain
end

#portsObject (readonly)

Returns the value of attribute ports.



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

def ports
  @ports
end