delete_field

delete_field(name)
Instance Public methods

Remove the named field from the object. Returns the value that the field contained if it was defined.

1
2
3
4
5
require 'ostruct'
 
person = OpenStruct.new('name' => 'John Smith', 'age' => 70)
 
person.delete_field('name'# => 'John Smith'
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.