Flowdock
method

[]=

Importance_1
Ruby on Rails latest stable (v4.0.2) - 0 notes - Class: ActiveRecord::AttributeMethods
[]=(attr_name, value) public

Updates the attribute identified by attr_name with the specified value. (Alias for the protected write_attribute method).

class Person < ActiveRecord::Base
end

person = Person.new
person[:age] = '22'
person[:age] # => 22
person[:age] # => Fixnum
Show source
Register or log in to add new notes.