开发者

missing method "to_yaml" in IronRuby

开发者 https://www.devze.com 2023-02-04 04:21 出处:网络
I created my own ruby console using IronRuby engine, but I can\'t get to_yaml to work on any of my .net classes.

I created my own ruby console using IronRuby engine, but I can't get to_yaml to work on any of my .net classes.

Did I missed anything?

person = Person.new
person.Name = 'John Doe'
person.Age = 26
puts person.to_yaml #does not wor开发者_Go百科k


It looks like YAML isn't included by default at startup. Try running

require 'yaml'

first - it made your code work for me in iirb.

0

精彩评论

暂无评论...
验证码 换一张
取 消