R
Raj Singh
This is irb.
=> ["1", "2", "3"]
irb(main):002:0> a.to_yaml
NoMethodError: undefined method `to_yaml' for ["1", "2", "3"]:Array
from (irb):2
This is Rails script/console
However no where in ActiveSupport I can find where Rails is implementing
the method to_yaml.
I go to http://www.ruby-doc.org/core/ and look for Array methods. I see
to_yaml. So why in the irb I am getting undefined method to_yaml?
irb(main):001:0> a = %w[ 1 2 3 ]
=> ["1", "2", "3"]
irb(main):002:0> a.to_yaml
NoMethodError: undefined method `to_yaml' for ["1", "2", "3"]:Array
from (irb):2
This is Rails script/console
=> "--- \n- \"1\"\n- \"2\"\n- \"3\"\n"a = %w[ 1 2 3] => ["1", "2", "3"]
a.to_yaml
However no where in ActiveSupport I can find where Rails is implementing
the method to_yaml.
I go to http://www.ruby-doc.org/core/ and look for Array methods. I see
to_yaml. So why in the irb I am getting undefined method to_yaml?