Class: Nginx::Config
- Inherits:
-
Object
- Object
- Nginx::Config
- Defined in:
- lib/nginx/server.rb
Instance Method Summary collapse
- #host(host) ⇒ Object
-
#initialize(dsl) ⇒ Config
constructor
A new instance of Config.
- #map(matcher, app) ⇒ Object
- #port(port) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(dsl) ⇒ Config
Returns a new instance of Config.
14 15 16 17 |
# File 'lib/nginx/server.rb', line 14 def initialize dsl @maps = {} instance_exec &dsl end |
Instance Method Details
#host(host) ⇒ Object
27 28 29 |
# File 'lib/nginx/server.rb', line 27 def host host @host = host end |
#map(matcher, app) ⇒ Object
35 36 37 |
# File 'lib/nginx/server.rb', line 35 def map matcher, app @maps[matcher] = app end |
#port(port) ⇒ Object
31 32 33 |
# File 'lib/nginx/server.rb', line 31 def port port @port = port end |
#to_hash ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/nginx/server.rb', line 19 def to_hash { host: @host, port: @port, maps: @maps, } end |