{"id":489,"date":"2005-10-26T01:00:00","date_gmt":"2005-10-25T16:00:00","guid":{"rendered":"https:\/\/ecoop.net\/memo\/2005-10-26-1.html"},"modified":"2005-10-26T01:00:00","modified_gmt":"2005-10-25T16:00:00","slug":"2005-10-26-1","status":"publish","type":"post","link":"https:\/\/www.ecoop.net\/memo\/archives\/2005-10-26-1.html","title":{"rendered":"\u30a2\u30af\u30bb\u30b5\u306e\u5b9a\u7fa9\u306e\u4ed5\u65b9"},"content":{"rendered":"<p>\n\u305d\u306e\uff11\n<\/p>\n<blockquote><p>attr_accessor :attr1, :attr2, :attr3# read\/write<br \/>\nattr_reader :attr3, :attr4          # read-only<br \/>\nattr_writer :attr5                  # write-only\n<\/p><\/blockquote>\n<p>&nbsp;: \u3092\u4f7f\u3046\u5ba3\u8a00\u5f0f\u5171\u901a\u306e\u6ce8\u610f\u4e8b\u9805\u3060\u304c\n<\/p>\n<blockquote><p>attr_accessor: attr1\n<\/p><\/blockquote>\n<p>\u306a\u3069\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b\u306e\u3067\u6ce8\u610f\u3002<br \/>\n&nbsp;: \u306f\u5148\u982d\u306e\u5ba3\u8a00\u306b\u304b\u304b\u308b\u306e\u3067\u306f\u306a\u304f\u5404\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u304b\u304b\u308b\u306e\u3067\u3001\u5404\u30d7\u30ed\u30d1\u30c6\u30a3\u3054\u3068\u306b\u7a7a\u767d\u3092\u631f\u307e\u305a\u5148\u982d\u306b : \u3092\u3064\u3051\u306a\u3044\u3068\u3044\u3051\u306a\u3044\u3002<br \/>\n&nbsp;@ \u3092\u3064\u3051\u305f\u540c\u540d\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5909\u6570\u306b\u5bfe\u3057\u3066\u306e\u30a2\u30af\u30bb\u30b5\u3068\u306a\u308b\u3002<br \/>\n&nbsp;<br \/>\n\u305d\u306e\uff12\n<\/p>\n<blockquote><p># reader<br \/>\ndef attr1<br \/>\n&nbsp;&nbsp;return @attr1<br \/>\nend<br \/>\n# writer<br \/>\ndef attr1= (arg)<br \/>\n&nbsp;&nbsp;@attr1 = arg<br \/>\nend\n<\/p><\/blockquote>\n<p>\u4efb\u610f\u306e\u5b9f\u88c5\u3092\u3057\u305f\u3044\u5834\u5408\u306f\u3053\u3061\u3089\u3092\u4f7f\u3046\u3002<br \/>\n&nbsp;<br \/>\n\u6bce\u56de\u5fd8\u308c\u308b\u306e\u3067\u30e1\u30e2\u3002\u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u8aad\u307f\u3065\u3089\u3044\u3063\u3059\u3002<br \/>\n\u53c2\u8003:<br \/>\n&lt;<a href=\"http:\/\/www.ruby-lang.org\/ja\/man\/?cmd=view;name=FAQ%3A%3A%A5%E1%A5%BD%A5%C3%A5%C9\">http:\/\/www.ruby-lang.org\/ja\/man\/?cmd=view;name=FAQ%3A%3A%A5%E1%A5%BD<br \/>\n%A5%C3%A5%C9<\/a>><br \/>\n&#8211; Ruby \u516c\u5f0f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 -> FAQ -> 5. \u30e1\u30bd\u30c3\u30c9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e\uff11 attr_accessor :attr1, :attr2, :attr3# read\/write attr_reader :attr3, :attr4 # read-only attr_writer :attr5 &hellip; <a href=\"https:\/\/www.ecoop.net\/memo\/archives\/2005-10-26-1.html\" class=\"more-link\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"screen-reader-text\">\u30a2\u30af\u30bb\u30b5\u306e\u5b9a\u7fa9\u306e\u4ed5\u65b9<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[15],"class_list":["post-489","post","type-post","status-publish","format-standard","hentry","tag-ruby"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/489","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/comments?post=489"}],"version-history":[{"count":0,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/posts\/489\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/media?parent=489"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/categories?post=489"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ecoop.net\/memo\/wp-json\/wp\/v2\/tags?post=489"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}