How to revise array

I have the following code:

@@available_columns = [
QueryColumn.new(:tracker, :sortable =>
“#{Tracker.table_name}.position”),
QueryColumn.new(:root_cause, :sortable =>
“#{RootCause.table_name}.position”),
QueryColumn.new(:project, :sortable => “#{Project.table_name}.name”),

]

After array initalization I want to revise several elements and delete
them from the array. How can I delete?

After array initalization I want to revise several elements and delete
them from the array. How can I delete?

@@available_columns.delete(obj)

On 12 Nov 2008, at 13:47, Thani A. wrote:

After array initalization I want to revise several elements and
delete
them from the array. How can I delete?

@@available_columns.delete(obj)

reject, delete_if and friends are often useful too.

Fred

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs