Changeset 12156
- Timestamp:
- 05/22/08 01:28:41 (5 years ago)
- Files:
-
- 1 modified
-
docs/moose-ja/Moose/Cookbook/Recipe1.ja.pod (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
docs/moose-ja/Moose/Cookbook/Recipe1.ja.pod
r12067 r12156 94 94 The next C<has> line is very similar, with only one difference: 95 95 96 次の C<has> は とても似ていますが一つだけ違うところがあります。 97 96 98 has 'y' => (isa => 'Int', is => 'rw'); 97 99 98 100 A read/write (abbreviated as C<rw>) accessor will be generated for 99 101 the C<y> attribute. 102 103 read/write (短縮すると C<rw>) accessorを C<y> attributeに生成します。 100 104 101 105 At this point the attributes have been defined, and it is time to … … 103 107 is just a subroutine defined within the package. So here we create 104 108 the C<clear> method. 109 110 このpointのattributeを定義し、メソッドを定義します。 111 Mooseでは、通常のPerl5 OOのようにメソッドをサブルーチンとして 112 packageに定義します。では C<clear> メソッドを作ります。 105 113 106 114 sub clear { … … 116 124 blessed HASH references. This means they are very compatible with 117 125 other Perl 5 (non-Moose) classes as well. 126 127 これはとても普通ですが、ひとつだけ付け加えるとインスタンスL<(2)>の 128 C<x> slotに直接アクセスしています。これは読み取り専用の値が 129 作成されています。このようにMooseオブジェクトは通常の以前からある 130 blessされたHASHリファレンスであり、通常から逸脱する 131 ものではありません。そしてこれは他のPerl5(Mooseではない)クラスとの 132 互換性がよく保たれるということです。 118 133 119 134 The next part of the code to review is the B<Point> subclass,
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)