summaryrefslogtreecommitdiff
path: root/struct.c
diff options
context:
space:
mode:
authormarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 03:43:45 +0000
committermarcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-12-23 03:43:45 +0000
commit9777547817c775cb2e767083385090dd79f77fff ()
tree788745b7343f29a3fc4ddd760429de4067d5d2f6 /struct.c
parent9cc112042413a8ba03542960185fbbc168b7d870 (diff)
Struct#to_h: Add doc for block form.
by Shuji Kobayashi [doc] [ci skip] [#15454] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--struct.c8
1 files changed, 7 insertions, 1 deletions
@@ -901,13 +901,19 @@ rb_struct_to_a(VALUE s)
/*
* call-seq:
- * struct.to_h -> hash
*
* Returns a Hash containing the names and values for the struct's members.
*
* Customer = Struct.new(:name, :address, :zip)
* joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
* joe.to_h[:address] #=> "123 Maple, Anytown NC"
*/
static VALUE