mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
struct.c: [DOC] improve docs for Struct.new
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61232 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
09004db450
commit
4a8aa278b5
1 changed files with 2 additions and 3 deletions
5
struct.c
5
struct.c
|
@ -475,11 +475,10 @@ rb_struct_define_under(VALUE outer, const char *name, ...)
|
|||
* Customer.new("Dave", "123 Main")
|
||||
* #=> #<struct Customer name="Dave", address="123 Main">
|
||||
*
|
||||
* If keyword_init: true option is given, .new takes keyword arguments instead
|
||||
* of normal arguments.
|
||||
* If the optional +keyword_init+ keyword argument is set to +true+,
|
||||
* .new takes keyword arguments instead of normal arguments.
|
||||
*
|
||||
* Customer = Struct.new(:name, :address, keyword_init: true)
|
||||
* #=> Customer
|
||||
* Customer.new(name: "Dave", address: "123 Main")
|
||||
* #=> #<struct Customer name="Dave", address="123 Main">
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue