summaryrefslogtreecommitdiffstats
path: root/lib/base/number-script.cpp
blob: 0dcaca58b3c7584b1c069e902a6cd22465bcb830 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* Icinga 2 | (c) 2012 Icinga GmbH | GPLv2+ */

#include "base/number.hpp"
#include "base/convert.hpp"
#include "base/function.hpp"
#include "base/functionwrapper.hpp"
#include "base/scriptframe.hpp"

using namespace icinga;

static String NumberToString()
{
	ScriptFrame *vframe = ScriptFrame::GetCurrentFrame();
	return vframe->Self;
}

Object::Ptr Number::GetPrototype()
{
	static Dictionary::Ptr prototype = new Dictionary({
		{ "to_string", new Function("Number#to_string", NumberToString, {}, true) }
	});

	return prototype;
}