Bug #7674

Document for using Struct.new with block

Added by Hiroyuki Iwatsuki over 1 year ago. Updated about 1 year ago.

[ruby-core:51314]
Status:Closed
Priority:Normal
Assignee:Zachary Scott
Category:doc
Target version:2.0.0
ruby -v:2.0.0 Backport:

Description

I wrote the document for using Struct.new with block.

struct.c.diff Magnifier (1.36 KB) Hiroyuki Iwatsuki, 01/08/2013 06:31 PM

struct.c.diff Magnifier (1.44 KB) Hiroyuki Iwatsuki, 01/09/2013 05:03 AM

Associated revisions

Revision 38883
Added by Zachary Scott about 1 year ago

  • struct.c (Struct.new): Document Struct.new with block Patch by Hiroyuki Iwatsuki [Bug #7674]

History

#1 Updated by Masaki Matsushita over 1 year ago

  • Tracker changed from Bug to Feature

#2 Updated by Nobuyoshi Nakada over 1 year ago

Nitpick.

  • Struct.new( [aString] [, aSym]+> ) {|| block } -> StructClass

Actually StructClass is passed to the block.

#3 Updated by Hiroyuki Iwatsuki over 1 year ago

=begin
Thank you for the comment! I understood.

$ ruby -e "p Struct.new(:x){|c| p(c, self)}"
#Class:0x007f8f738b9d90
#Class:0x007f8f738b9d90
#Class:0x007f8f738b9d90

I updated the patch.
=end

#4 Updated by Zachary Scott over 1 year ago

  • Category set to doc
  • Assignee set to Zachary Scott
  • Target version set to 2.0.0

#5 Updated by Zachary Scott about 1 year ago

  • Tracker changed from Feature to Bug
  • ruby -v set to 2.0.0

missing documentation considered bug

#6 Updated by Zachary Scott about 1 year ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r38883.
Hiroyuki, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


  • struct.c (Struct.new): Document Struct.new with block Patch by Hiroyuki Iwatsuki [Bug #7674]

Also available in: Atom PDF