summaryrefslogtreecommitdiff
path: root/src/node.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/node.erl')
-rw-r--r--src/node.erl39
1 files changed, 39 insertions, 0 deletions
diff --git a/src/node.erl b/src/node.erl
new file mode 100644
index 00000000..9a9c82c1
--- /dev/null
+++ b/src/node.erl
@@ -0,0 +1,39 @@
+%%%-------------------------------------------------------------------
+%%% File: node.erl
+%%% @author Cliff Moon <> []
+%%% @copyright 2009 Cliff Moon
+%%% @doc
+%%%
+%%% @end
+%%%
+%%% @since 2009-05-11 by Cliff Moon
+%%%-------------------------------------------------------------------
+-module(node).
+-author('cliff@powerset.com').
+
+%% API
+-export([name/1, attributes/1]).
+
+-include("../include/common.hrl").
+
+%% -ifdef(TEST).
+%% -include("../etest/node_test.erl").
+%% -endif.
+
+%%====================================================================
+%% API
+%%====================================================================
+
+name(Name) when is_atom(Name) ->
+ Name;
+name(Node) when is_tuple(Node) ->
+ element(1, Node);
+name(Node) ->
+ Node.
+
+attributes(Name) when is_atom(Name) ->
+ [];
+attributes(Node) when is_tuple(Node) ->
+ element(2, Node);
+attributes(_) ->
+ [].