def self.jq_column_models
COLUMN_NAME.collect {|x|
{:name => x.to_s, :width => 80, :format => 'integer' if x.is_a?(Fixnum)}
}
end
I wrote the code :format => 'integer' if x.is_a? to add a :format when |x| is only integer type. But it isn’t compiled. How do you express this code by ruby?
You can use tap(yield self; self):