{"id":440,"date":"2008-01-02T23:41:21","date_gmt":"2008-01-02T14:41:21","guid":{"rendered":"http:\/\/ecpplus.net\/weblog\/archives\/440"},"modified":"2020-06-26T01:57:35","modified_gmt":"2020-06-25T16:57:35","slug":"send%e3%81%a7%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%ae%e3%83%97%e3%83%ad%e3%83%91%e3%83%86%e3%82%a3%e3%81%ab%e4%bb%a3%e5%85%a5","status":"publish","type":"post","link":"https:\/\/ecpplus.net\/weblog\/send%e3%81%a7%e3%82%aa%e3%83%96%e3%82%b8%e3%82%a7%e3%82%af%e3%83%88%e3%81%ae%e3%83%97%e3%83%ad%e3%83%91%e3%83%86%e3%82%a3%e3%81%ab%e4%bb%a3%e5%85%a5\/","title":{"rendered":"Send\u3067\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u4ee3\u5165"},"content":{"rendered":"<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092 send \u30e1\u30bd\u30c3\u30c9\u3067\u53c2\u7167\u3059\u308b\u306b\u306f\u3001send \u306e\u5f15\u6570\u306b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u540d\u524d\u3092\u6e21\u305b\u3070\u3044\u3044\u3002<\/p>\n<p>\u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aUser\u30af\u30e9\u30b9\u304c\u3042\u3063\u305f\u3068\u304d\u306b send \u3067 name\u3092\u3072\u3063\u3071\u3063\u3066\u6765\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059\u308b\u3002<\/p>\n<pre lang=\"ruby\">class User\n  attr_accessor :name, :email\n  def initialize(name, email)\n    @name = name\n    @email = email\n  end\nend\n\n>> user = User.new('chu', 'chu@example.com')\n=> #<user:0x2b5764296468 @email=\"chu@example.com\", @name=\"chu\">\n>> user.name\n=> \"chu\"\n>> user.send('name')\n=> \"chu\"<\/pre>\n<p>\u8a2d\u5b9a\u30d5\u30a1\u30a4\u30eb\u3067\u30d5\u30a3\u30fc\u30eb\u30c9\u6c7a\u3081\u3066\u5185\u90e8\u3067\u51e6\u7406\u3059\u308b\u3088\u3046\u306a\u3068\u304d\u306f\u3088\u304f\u4f7f\u3046\u3002<\/p>\n<p>\u6b21\u306b\u3001send \u3092\u4f7f\u3063\u3066\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u306b \u5024\u3092\u8a2d\u5b9a\u3057\u305f\u3044\u5834\u5408\u306f\u3001 send \u306b\u5f15\u6570\u3092\u4e8c\u3064\u6e21\u3059\u3002 ruby \u306f \u30d7\u30ed\u30d1\u30c6\u30a3\u3078\u306e\u30a2\u30af\u30bb\u30b9\u3082\u5168\u3066\u30e1\u30bd\u30c3\u30c9\u306b\u306a\u3063\u3066\u308b\u3002<\/p>\n<p>name\u5c5e\u6027\u3078\u306e\u4ee3\u5165\u306f\u3001 name= \u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u306b\u5f15\u6570\u3092\u6e21\u3057\u3066\u3044\u308b\u3053\u3068\u306b\u306a\u308b\u3002<\/p>\n<blockquote>\n<blockquote><p>\n    user = User.new(&#8216;chu&#8217;, &#8216;chu@example.com&#8217;)<br \/>\n    => #<user:0x2b5764296468 @email=\"chu@example.com\", @name=\"chu\"><br \/>\n    user.send(&#8216;name=&#8217;, &#8216;chu2&#8217;)<br \/>\n    => &#8220;chu2&#8221;<br \/>\n    user.name<br \/>\n    => &#8220;chu2&#8221;\n  <\/p><\/blockquote>\n<\/blockquote>\n<p>send \u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u307f\u305f\u3089\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u305f\u3002\u7b2c\u4e00\u5f15\u6570\u306b\u30e1\u30bd\u30c3\u30c9\u540d\u3092\u6e21\u3057\u3066\u3001\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u5bfe\u3059\u308b\u5f15\u6570\u306f\u53ef\u5909\u9577\u306e\u7b2c\u4e8c\u5f15\u6570\u4ee5\u964d\u306b\u6e21\u305b\u3070\u3044\u3044\u307f\u305f\u3044\u3002<\/p>\n<blockquote><p>send(name[, args &#8230; ])<br \/>\nsend(name[, args &#8230; ]) { &#8230;. }<br \/>\n__send__(name[, args &#8230; ])<br \/>\n__send__(name[, args &#8230; ]) { &#8230; }<\/p>\n<p>    \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30e1\u30bd\u30c3\u30c9 name \u3092\u3001\u5f15\u6570\u306b args \u3092\u6e21\u3057\u3066\u547c\u3073\u51fa\u3057\u3001\u30e1\u30bd\u30c3\u30c9\u306e\u5b9f\u884c\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u3002<br \/>\n    \u30d6\u30ed\u30c3\u30af\u4ed8\u304d\u3067\u547c\u3070\u308c\u305f\u3068\u304d\u306f\u30d6\u30ed\u30c3\u30af\u3082\u305d\u306e\u307e\u307e\u5f15\u304d\u6e21\u3057\u307e\u3059\u3002\u30e1\u30bd\u30c3\u30c9\u540d name \u306f\u6587\u5b57\u5217\u304bSymbol \u3067\u3059\u3002<br \/>\n    send \u304c\u518d\u5b9a\u7fa9\u3055\u308c\u305f\u5834\u5408\u306b\u5099\u3048\u3066\u5225\u540d __send__ \u3082\u7528\u610f\u3055\u308c\u3066\u304a\u308a\u3001\u30e9\u30a4\u30d6\u30e9\u30ea\u3067\u306f\u3053\u3061\u3089\u3092\u4f7f\u3046\u3079\u304d\u3067\u3059\u3002\u307e\u305f __send__ \u306f\u518d\u5b9a\u7fa9\u3059\u3079\u304d\u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n    send, __send__ \u306f\u3001\u547c\u3073\u51fa\u3057\u5236\u9650 \u306b\u304b\u304b\u308f\u3089\u305a\u4efb\u610f\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u305b\u307e\u3059\u3002<br \/>\n    ruby 1.9 feature: \u547c\u3073\u51fa\u3057\u5236\u9650\u304csend, __send__\u306b\u3082\u5f71\u97ff\u3059\u308b\u3088\u3046\u306b\u306a\u308a\u3001\u30ec\u30b7\u30fc\u30d0\u3092\u6307\u5b9a\u3057\u305f\u547c\u3073\u51fa\u3057\u3067\u306fprivate\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u305b\u306a\u304f\u306a\u308a\u307e\u3057\u305f\u3002 private\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3059\u5fc5\u8981\u304c\u3042\u308b\u5834\u5408\u306finstance_eval\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p><\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e\u30d7\u30ed\u30d1\u30c6\u30a3\u3092 send \u30e1\u30bd\u30c3\u30c9\u3067\u53c2\u7167\u3059\u308b\u306b\u306f\u3001send \u306e\u5f15\u6570\u306b\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u540d\u524d\u3092\u6e21\u305b\u3070\u3044\u3044\u3002 \u305f\u3068\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306aUser\u30af\u30e9\u30b9\u304c\u3042\u3063\u305f\u3068\u304d\u306b send \u3067 name\u3092\u3072\u3063\u3071\u3063\u3066\u6765\u308b\u306b\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2872,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[8],"class_list":["post-440","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-development","tag-ruby"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/440","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/comments?post=440"}],"version-history":[{"count":2,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/440\/revisions"}],"predecessor-version":[{"id":2880,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/posts\/440\/revisions\/2880"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media\/2872"}],"wp:attachment":[{"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/media?parent=440"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/categories?post=440"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecpplus.net\/weblog\/wp-json\/wp\/v2\/tags?post=440"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}