97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'lib/zafu/process/ruby_less_processing.rb', line 97
def get_attribute_or_eval(use_string_block = true)
if @params[:date] && method != 'link'
return parser_continue("'date' parameter is deprecated. Please use 'attr' or 'eval'.")
elsif attribute = @params[:attr]
code = "this.#{attribute}"
elsif code = @params[:eval] || @params[:test]
elsif code = @params[:param]
code = "params[:#{code}]"
elsif text = @params[:text]
code = "%Q{#{text}}"
elsif text = @params[:t]
code = "t(%Q{#{text}})"
elsif use_string_block && @blocks.size == 1 && @blocks.first.kind_of?(String)
return RubyLess::TypedString.new(@blocks.first.inspect, :class => String, :literal => @blocks.first)
else
return parser_continue("Missing attribute/eval parameter")
end
RubyLess.translate(self, code)
rescue RubyLess::Error => err
return parser_continue(err.message, code)
end
|