aboutsummaryrefslogtreecommitdiff
path: root/model/booleanNode.go
diff options
context:
space:
mode:
Diffstat (limited to 'model/booleanNode.go')
-rw-r--r--model/booleanNode.go16
1 files changed, 16 insertions, 0 deletions
diff --git a/model/booleanNode.go b/model/booleanNode.go
new file mode 100644
index 0000000..bc2d60e
--- /dev/null
+++ b/model/booleanNode.go
@@ -0,0 +1,16 @@
+package model
+
+type BooleanNode struct {
+ Value bool
+}
+
+func (n BooleanNode) Type() NodeType {
+ return BooleanType
+}
+
+func (n *BooleanNode) MarshalJSON() ([]byte, error) {
+ if n.Value {
+ return []byte("true"), nil
+ }
+ return []byte("false"), nil
+}