RubyのYAML簡単サンプルコード

rubyコード:
require 'yaml’

class Person
attr_accessor :name, :age
end

fred = Person.new
fred.name = “山田 恵助"
fred.age = 45

laura = Person.new
laura.name = “小沢 次郎"
laura.age = 23

test_data = [ fred, laura ]

puts YAML::dump(test_data)

Development

Posted by arkgame