1 /* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */
3 #include "base/boolean.hpp"
4 #include "base/convert.hpp"
5 #include "base/function.hpp"
6 #include "base/functionwrapper.hpp"
7 #include "base/scriptframe.hpp"
9 using namespace icinga;
11 static String BooleanToString()
13 ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
14 bool self = vframe->Self;
15 return self ? "true" : "false";
18 Object::Ptr Boolean::GetPrototype()
20 static Dictionary::Ptr prototype = new Dictionary({
21 { "to_string", new Function("Boolean#to_string", BooleanToString, {}, true) }