summaryrefslogtreecommitdiffstats
path: root/aconf/model/set.lua
diff options
context:
space:
mode:
authorKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2015-04-03 10:40:28 +0300
committerKaarle Ritvanen <kaarle.ritvanen@datakunkku.fi>2015-04-10 18:17:00 +0300
commita92dc45aee3f599926c77294328db38c5b2544eb (patch)
tree0f31580b868245cabe733864f9d99901730c3279 /aconf/model/set.lua
parent3baaf91de453d35b095881478be8d88b3fc2b97a (diff)
downloadaconf-a92dc45aee3f599926c77294328db38c5b2544eb.tar.bz2
aconf-a92dc45aee3f599926c77294328db38c5b2544eb.tar.xz
docs: describe functionality used in the dnsmasq modulev0.5.0
Diffstat (limited to 'aconf/model/set.lua')
-rw-r--r--aconf/model/set.lua13
1 files changed, 13 insertions, 0 deletions
diff --git a/aconf/model/set.lua b/aconf/model/set.lua
index 897e1bf..dd28a2e 100644
--- a/aconf/model/set.lua
+++ b/aconf/model/set.lua
@@ -3,6 +3,7 @@ Copyright (c) 2012-2015 Kaarle Ritvanen
See LICENSE file for license details
--]]
+--- @module aconf.model
local M = {}
local TreeNode = require('aconf.model.field').TreeNode
@@ -12,6 +13,13 @@ local pth = require('aconf.path')
local util = require('aconf.util')
+--- set object, inherits @{node.List}. An instance of this class represents
+-- a set object in the data model, in the context of a specific
+-- transaction. A set is an unordered collection of primitive
+-- values. Members can be inserted to the set using
+-- @{node.insert}. Members can be removed by assigning the nil value
+-- to the key to be removed.
+-- @klass node.Set
M.Set = object.class(require('aconf.model.node').List)
function M.Set:init(context, params)
@@ -48,6 +56,11 @@ function M.Set:init(context, params)
mt.save(i, nil)
end
+ --- determines if the given set contains the given value.
+ -- @function node.contains
+ -- @tparam node.Set set set
+ -- @tparam primitive v value
+ -- @treturn boolean true if the set contains the value
function mt.contains(v) return find(v) and true or false end
local insert = mt.insert