From 28a0bc8c32d5e68f1a2ede45e8407a5f2f3acc64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Smr=C5=BE?= <roman.smrz@seznam.cz>
Date: Tue, 30 Jul 2024 18:20:03 +0200
Subject: Add network member to the node object

Changelog: Add network member to the node object
---
 README.md      | 12 +++++++++---
 src/Network.hs |  1 +
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 3b0397d..0cf5f21 100644
--- a/README.md
+++ b/README.md
@@ -173,11 +173,16 @@ Represents network/subnet, created by `subnet` command and used by `subnet`, `no
 
 #### node
 
-Represents network node, created by `node` command and used by `spawn` or network configuration commands.
+Represents network node, created by `node` command or implicitly by `spawn`,
+and used by `spawn` or network configuration commands.
 
 Members:
 
-`ip`: string representation of node's IP address.
+`ip`
+: String representation of node's IP address.
+
+`network`
+: The network which the node belogs to.
 
 #### process
 
@@ -185,7 +190,8 @@ Represents running process. Created by `spawn`, used by `send` and `expect` comm
 
 Members:
 
-`node`: node on which the process is running
+`node`
+: Node on which the process is running.
 
 #### list
 
diff --git a/src/Network.hs b/src/Network.hs
index d892404..7f0896c 100644
--- a/src/Network.hs
+++ b/src/Network.hs
@@ -110,6 +110,7 @@ instance ExprType Node where
 
     recordMembers = map (first T.pack)
         [ ("ip", RecordSelector $ textIpAddress . nodeIp)
+        , ("network", RecordSelector $ nodeNetwork)
         ]
 
 
-- 
cgit v1.2.3