method
yaml_new
v1_9_1_378 -
Show latest stable
-
1 note -
Class: String
- 1_8_6_287 (0)
- 1_8_7_72 (0)
- 1_8_7_330 (0)
- 1_9_1_378 (0)
- 1_9_2_180
- 1_9_3_125
- 1_9_3_392
- 2_1_10
- 2_2_9
- 2_4_6
- 2_5_5
- 2_6_3
- What's this?
Register or
log in
to add new notes.
dvdplm -
February 5, 2009
1 thank
Weird method...
Takes three params:
- a Class constant (has to be an existing class) - a "tag" param that, if set to "tag:yaml.org,2002:binary" will call unpack("m") on the third parameter, val; any other values for tag are ignored - val can be a Hash or a String; if it's a string it is wrapped in a hash {'str' => val}, other wise...
-
an instance of klass is allocated
-
an instance of string is initialized, with the val parameter, and bound to the class context
-
for each key in val (if any!), set instance variables in the instantiated class
So, what does this method do, a part from making my eyes hurt? It loads a yaml file and instantiates a class and sets the ivars found in the yaml file. Sorta.
It is probably the worst code I have ever seen in the ruby standard libs. WTF!!
:)