From 6fce297e9ff9f495b10281f2c5c78e6e0c2d48ad Mon Sep 17 00:00:00 2001 From: Joe Date: Mon, 22 Feb 2010 12:19:15 -0800 Subject: merge attempt #1 --- src/node.erl | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 src/node.erl (limited to 'src/node.erl') 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(_) -> + []. -- cgit v1.2.3