[Nitro] strange syntax in og/entity.rb

Dimitri Aivaliotis aglarond at gmail.com
Thu Apr 20 09:52:41 EDT 2006


On 4/20/06, Stephan Walter <news at stephan.walter.name> wrote:

> %|#{field_name} #{options.delete("#{name}_op".to_sym) || '='} #{ogmanager.store.quote(value)}|

Isn't this a non-issue?  I just tried it out in irb, with some dummy variables:

field_name = "test field name"
options = [ :test_op, :field_op ]
name = "field"

%|#{field_name} #{options.delete("#{name}_op".to_sym) || '='} #{name}|
=> "test field name = field"

options
=> [:test_op]

The ruby parser is intelligent enough to recognize a || within a %||,
or that's at least what it looks like...

- Dimitri




More information about the Nitro-general mailing list