core/moduleapi.lua
changeset 5527 7e7f45f587a1
parent 5526 d54011a23b20
child 5529 af58eea131b4
equal deleted inserted replaced
5526:d54011a23b20 5527:7e7f45f587a1
   268 	end
   268 	end
   269 	
   269 	
   270 	return set.new(value);
   270 	return set.new(value);
   271 end
   271 end
   272 
   272 
       
   273 function api:get_option_inherited_set(name, ...)
       
   274 	local value = self:get_option_set(name, ...);
       
   275 	local global_value = self:context("*"):get_option_set(name, ...);
       
   276 	if not value then
       
   277 		return global_value;
       
   278 	elseif not global_value then
       
   279 		return value;
       
   280 	end
       
   281 	value:include(global_value);
       
   282 	return value;
       
   283 end
       
   284 
   273 function api:context(host)
   285 function api:context(host)
   274 	return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
   286 	return setmetatable({host=host or "*"}, {__index=self,__newindex=self});
   275 end
   287 end
   276 
   288 
   277 function api:add_item(key, value)
   289 function api:add_item(key, value)