PageRenderTime 13ms CodeModel.GetById 8ms app.highlight 2ms RepoModel.GetById 2ms app.codeStats 0ms

/modules/mod_base/filters/filter_is_defined.erl

http://github.com/zotonic/zotonic
Erlang | 28 lines | 8 code | 4 blank | 16 comment | 0 complexity | eafe76ac5cf8743da8e4bc2b7a525d2d MD5 | raw file
 1%% @author Marc Worrell <marc@worrell.nl>
 2%% @copyright 2010 Marc Worrell
 3%% @doc 'is_defined' filter, test if a value is defined
 4
 5%% Copyright 2010 Marc Worrell
 6%%
 7%% Licensed under the Apache License, Version 2.0 (the "License");
 8%% you may not use this file except in compliance with the License.
 9%% You may obtain a copy of the License at
10%% 
11%%     http://www.apache.org/licenses/LICENSE-2.0
12%% 
13%% Unless required by applicable law or agreed to in writing, software
14%% distributed under the License is distributed on an "AS IS" BASIS,
15%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16%% See the License for the specific language governing permissions and
17%% limitations under the License.
18
19-module(filter_is_defined).
20-export([is_defined/2]).
21
22
23is_defined(undefined, _Context) ->
24    false;
25is_defined({{9999,_,_},{_,_,_}}, _Context) ->
26	false;
27is_defined(_V, _Context) ->
28    true.