aboutsummaryrefslogtreecommitdiff
path: root/model/booleanNode.go
diff options
context:
space:
mode:
authorNeonXP <i@neonxp.dev>2022-11-21 04:31:56 +0300
committerNeonXP <i@neonxp.dev>2022-11-21 04:31:56 +0300
commit4054a50ce4232ebfc4dae043863ad96d46b25b43 (patch)
tree4ee57f8b0b5f66b142bb3898ba6e8162cb1b2a01 /model/booleanNode.go
parent4934a51c69e1975dc808e094e113b187ebb2c328 (diff)
Better interfacev0.0.3
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
+}