7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/clot/tag_helper.rb', line 7
def resolve_value(value, context)
case value
when Liquid::Drop then
value.source
when /^([\[])(.*)([\]])$/ then
array = $2.split " "; array.map { |item| resolve_value item, context }
when /^"(\{.*\})"$/ then
eval($1) when /^(["'])(.*)\1$/ then
$2
when /^(\d+[\.]\d+)$/ then
$1.to_f
when /^(\d+)$/ then
value.to_i
when /^true$/ then
true
when /^false$/ then
false
when /^nil$/ then
nil
when /^(.+)_path$/ then
"/#{$1}"
else
context[value]
end
end
|