method

[]

Importance_1
Ruby latest stable (v2_5_5) - 0 notes - Class: OpenStruct
[](name) public

Returns the value of an attribute.

require "ostruct"
person = OpenStruct.new("name" => "John Smith", "age" => 70)
person[:age]   # => 70, same as person.age
Show source
Register or log in to add new notes.