Ruby/Class/OpenStruct
Материал из Wiki.crossplatform.ru
Версия от 17:10, 26 мая 2010; (Обсуждение)
OpenStruct class provided by the ostruct library makes it even easier.
# Create data objects without specifying the attributes # Create attributes on the fly: require "ostruct" person = OpenStruct.new person.name = "Tom" person.age = 25