class Object
Public Instance Methods
nginx_conf(&block)
click to toggle source
# File lib/nginx-conf/nginx_conf.rb, line 8 def nginx_conf &block repeats = %i(server load_module fastcgi_param set if_) Compiler.new(replace_elems repeats) .compile replace_elems(block_is_hash(repeats, &block)) end
replace_elems(object)
click to toggle source
# File lib/nginx-conf/nginx_conf.rb, line 15 def replace_elems object map = { if_: :if, return_: :return } map_rec object do |x| if map.keys.include? x map[x] else x end end end