{"id":4546,"date":"2019-10-01T11:36:35","date_gmt":"2019-10-01T02:36:35","guid":{"rendered":"https:\/\/yumishin.com\/?p=4546"},"modified":"2019-10-01T11:36:35","modified_gmt":"2019-10-01T02:36:35","slug":"ruby-progate-9","status":"publish","type":"post","link":"https:\/\/yumishin.com\/?p=4546","title":{"rendered":"Ruby\u5165\u9580\uff5c\u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066\uff08\u4f7f\u3044\u65b9\u30fb\u66f8\u304d\u65b9\u30fb\u7701\u7565\u5f62\uff09"},"content":{"rendered":"<div class=\"sng-box box3\">\n<p>\uff1c\u3053\u306e\u8a18\u4e8b\u306f\u3053\u3093\u306a\u4eba\u306b\u304a\u3059\u3059\u3081\uff1e<\/p>\n<ul>\n<li>Ruby\u306e\u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u4eba<\/li>\n<li>\u30cf\u30c3\u30b7\u30e5\u306e\u4f7f\u3044\u65b9\u3084\u7701\u7565\u5f62\u3092\u77e5\u308a\u305f\u3044\u4eba<\/li>\n<li>Ruby\u5165\u9580\u8005<\/li>\n<\/ul>\n<\/div>\n<div class=\"sng-box box3\">\n<p>\uff1c\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068\uff1e<\/p>\n<ul>\n<li>\u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9<\/li>\n<li>\u30cf\u30c3\u30b7\u30e5\u306e\u4f7f\u3044\u65b9<\/li>\n<li>\u30cf\u30c3\u30b7\u30e5\u306e\u7701\u7565\u5f62<\/li>\n<\/ul>\n<\/div>\n<h2 id=\"i-0\">\u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4558\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/10\/20-1.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<p>\u8907\u6570\u306e\u5024\u3092\u307e\u3068\u3081\u3066\u7ba1\u7406\u3059\u308b\u4ee3\u8868\u7684\u306a\u65b9\u6cd5\u306b\u306f\u914d\u5217\u304c\u3042\u308a\u307e\u3059\u304c\u3001<span style=\"color: #ff0000;\">\u30cf\u30c3\u30b7\u30e5\u3082\u3042\u308a\u307e\u3059\u3002<\/span>\u30cf\u30c3\u30b7\u30e5\u306e\u57fa\u672c\u7684\u306a\u3053\u3068\u306b\u3064\u3044\u3066\u6b21\u306b\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u8907\u6570\u306e\u5024\u3092\u307e\u3068\u3081\u3066\u7ba1\u7406\u3059\u308b\u65b9\u6cd5\u304c\u30cf\u30c3\u30b7\u30e5<\/li>\n<li>\u30ad\u30fc\u3068\u547c\u3070\u308c\u308b\u540d\u524d\u3068\u3001\u5024\u3092\u30bb\u30c3\u30c8\u306b\u3057\u3066\u7ba1\u7406\u3059\u308b<\/li>\n<li>\u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9\u3000{\u30ad\u30fc\uff11=&gt; \u5024\uff11, \u30ad\u30fc\uff12 =&gt; \u5024\uff12}<\/li>\n<\/ul>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u5909\u6570exam\u306b\u30cf\u30c3\u30b7\u30e5\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u201dsubject\u201d=&gt;\u201dMath\u201d\u3068\u3059\u308b\u3053\u3068\u3067\u3001\u5024\u3092\u30bb\u30c3\u30c8\u306b\u3057\u3066\u6271\u3046\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\"># \u5909\u6570exam\u306b\u30cf\u30c3\u30b7\u30e5\u3092\u4ee3\u5165\u3057\u3066\u304f\u3060\u3055\u3044\nexam = {\"subject\"=&gt;\"Math\", \"score\"=&gt; 80}\n\n# \u5909\u6570exam\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs exam<\/pre>\n<div class=\"sng-box box3\">\n<p>\u30cf\u30c3\u30b7\u30e5\u306f\u3072\u3068\u3064\u306e\u5024\u306a\u306e\u3067\u3001\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u306e\u3088\u3046\u306b\u5909\u6570\u306b\u4ee3\u5165\u3057\u3066\u4f7f\u3046\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<\/div>\n<h2 id=\"i-1\">\u30cf\u30c3\u30b7\u30e5\u306e\u8981\u7d20\u306e\u300c\u4f7f\u3044\u65b9\u300d\u300c\u66f4\u65b0\u300d\u300c\u4f7f\u3044\u65b9\u300d<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4560\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/10\/22.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<h3 id=\"i-2\">\u8981\u7d20\u306e\u4f7f\u3044\u65b9<\/h3>\n<p><span style=\"color: #ff0000;\">\u30cf\u30c3\u30b7\u30e5\u306e\u8981\u7d20\u3092\u5229\u7528\u3059\u308b\u306b\u306f\u5909\u6570[\u30ad\u30fc]\u3068\u3044\u3046\u5f62\u3067\u4f7f\u3044\u307e\u3059\u3002<\/span><\/p>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u201dsubject\u201d\u306e\u5024\u3092\u51fa\u529b\u3059\u308b\u305f\u3081\u306b\u306f\u3001exam[\u201csubject\u201d]\u3068\u3059\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">exam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u30ad\u30fc\u300c\"subject\"\u300d\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs exam[\"subject\"] #=&gt; Math\n<\/pre>\n<h3 id=\"i-3\">\u8981\u7d20\u306e\u66f4\u65b0<\/h3>\n<p><span style=\"color: #ff0000;\">\u8981\u7d20\u3092\u66f4\u65b0\u3059\u308b\u306b\u306f\u3001\u3059\u3067\u306b\u5b58\u5728\u3059\u308b\u30ad\u30fc\u3092\u6307\u5b9a\u3057\u3066\u3001\u305d\u3053\u306b\u65b0\u305f\u306a\u5024\u3092\u4ee3\u5165\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/span><\/p>\n<p>\u4f8b\u3048\u3070\u3001\u201dsubject\u201d\u306e\u5024\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u306fexam[\u201csubject\u201d]\u306b\u65b0\u305f\u306a\u201dScience\u201d\u3068\u3044\u3046\u6587\u5b57\u5217\u3092\u4ee3\u5165\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3082\u3068\u3082\u3068\u3042\u3063\u305f\u201dMath\u201d\u3068\u3044\u3046\u6587\u5b57\u5217\u304c\u66f4\u65b0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">exam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u30ad\u30fc\u300c\"subject\"\u300d\u306e\u5024\u3092\u300c\"Science\"\u300d\u306b\u66f4\u65b0\u3057\u3066\u304f\u3060\u3055\u3044\nexam[\"subject\"] = \"Science\"\n\n# \u3082\u3046\u4e00\u5ea6\u3001\u30ad\u30fc\u300c\"subject\"\u300d\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs exam[\"subject\"]\n<\/pre>\n<h3 id=\"i-4\">\u8981\u7d20\u306e\u8ffd\u52a0<\/h3>\n<p><span style=\"color: #ff0000;\">\u30cf\u30c3\u30b7\u30e5\u306b\u65b0\u3057\u304f\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u306f\u3001\u65b0\u3057\u3044\u30ad\u30fc\u306b\u65b0\u3057\u3044\u5024\u3092\u4ee3\u5165\u3057\u3066\u3042\u3052\u308c\u3070OK\u3067\u3059\u3002<\/span><\/p>\n<p>\u4f8b\u3048\u3070\u3001exam\u3068\u3044\u3046\u5909\u6570\u306b\u65b0\u305f\u306b\u201dgrade\u201d\u3068\u3044\u3046\u30ad\u30fc\u3068\u3001\u201dgood\u201d\u3068\u3044\u3046\u5024\u3092\u5165\u308c\u305f\u3044\u3068\u3057\u307e\u3059\u3002\u305d\u306e\u5834\u5408\u306fexam[\u201cgrade\u201d]=\u201dgood\u201d\u3068\u3044\u3046\u5f62\u3067\u65b0\u305f\u306b\u30ad\u30fc\u3092\u4f5c\u308a\u3001\u5024\u3092\u4ee3\u5165\u3057\u3066\u304f\u3060\u3055\u3044\u3002\u8981\u7d20\u304c\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">exam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u30ad\u30fc\u304c\u300c\"grade\"\u300d\u3001\u5024\u304c\u300c\"good\"\u300d\u306e\u8981\u7d20\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\nexam[\"grade\"] = \"good\"\n\n# \u30ad\u30fc\u300c\"grade\"\u300d\u306e\u5024\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs exam[\"grade\"]\n<\/pre>\n<h2 id=\"i-5\">\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u305f\u30cf\u30c3\u30b7\u30e5\u306e\u7701\u7565\u5f62<\/h2>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4561\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/10\/23.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<h3 id=\"i-6\">\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u305f\u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9<\/h3>\n<p>\u30cf\u30c3\u30b7\u30e5\u306f\u3088\u304f\u4f7f\u308f\u308c\u308b\u305f\u3081\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u305f\u7701\u7565\u5f62\u304c\u3042\u308a\u307e\u3059\u3002\u6b21\u306e\u3088\u3046\u306a\u5f62\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default mark:4 decode:true\">exam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u30ad\u30fc\u3092\u30b7\u30f3\u30dc\u30eb\u3067\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\nexam = {:subject =&gt; \"Math\", :score =&gt; 80}<\/pre>\n<p>\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u305f\u30cf\u30c3\u30b7\u30e5\u7701\u7565\u5f62\u306e\u4e00\u822c\u7684\u306a\u30eb\u30fc\u30eb\u306b\u3064\u3044\u3066\u4ee5\u4e0b\u306b\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30cf\u30c3\u30b7\u30e5\u306f\u5148\u982d\u306b\u30b3\u30ed\u30f3\u3092\u3064\u3051\u305f\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u3066\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b<\/li>\n<li>\u30b7\u30f3\u30dc\u30eb\u306f\u30ad\u30fc\u90e8\u5206\u306b\u3088\u304f\u4f7f\u308f\u308c\u308b<\/li>\n<li>\u6587\u5b57\u5217\u3068\u30b7\u30f3\u30dc\u30eb\u306f\u53b3\u5bc6\u306b\u306f\u9055\u3046\u304c\u3001\u57fa\u672c\u7684\u306b\u306f\u540c\u3058\u3088\u3046\u306b\u4f7f\u3048\u308b<\/li>\n<\/ul>\n<h3 id=\"i-7\">\u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9\u7701\u7565\u5f62<\/h3>\n<p><span style=\"color: #ff0000;\">\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3063\u305f\u30cf\u30c3\u30b7\u30e5\u3082\u3055\u3089\u306b\u7701\u7565\u3067\u304d\u307e\u3059\u3002<\/span><\/p>\n<pre class=\"lang:default mark:4 decode:true\">exam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u7701\u7565\u3057\u305f\u66f8\u304d\u65b9\u3067\u66f8\u304d\u63db\u3048\u3066\u304f\u3060\u3055\u3044\nexam = {subject: \"Math\", score: 80}\n<\/pre>\n<p><span style=\"color: #ff0000;\">\u3064\u307e\u308a\u300ckey =&gt;\u300d\u306f\u300ckey :\u300d\u3068\u7701\u7565\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3059\u3002<\/span>\u3053\u306e\u4f7f\u3044\u65b9\u306f\u3088\u304f\u51fa\u3066\u304f\u308b\u306e\u3067\u3001\u899a\u3048\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<div class=\"sng-box box3\">\n<p>\u3061\u306a\u307f\u306b\u7701\u7565\u5f62\u306b\u304a\u3051\u308b\u8981\u7d20\u306e\u4f7f\u3044\u65b9\u3067\u3059\u304c\u3001exam[:subject]\u3068\u3044\u3046\u3088\u3046\u306b[\u3000]\u5185\u3092\u30b7\u30f3\u30dc\u30eb\u3067\u8a18\u8ff0\u3059\u308b\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<\/div>\n<h2 id=\"i-8\">\u307e\u3068\u3081<\/h2>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u4eca\u56de\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3057\u305f\u3002\u7279\u306b\u6b21\u306e\u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9\u306b\u3064\u3044\u3066\u306f\u3088\u304f\u78ba\u8a8d\u3057\u3066\u304a\u3044\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<pre class=\"lang:default decode:true\">#\u30ad\u30fc\u304c\u6587\u5b57\u5217\nexam = {\"subject\" =&gt; \"Math\", \"score\" =&gt; 80}\n\n# \u30ad\u30fc\u304c\u30b7\u30f3\u30dc\u30eb\nexam = {:subject =&gt; \"Math\", :score =&gt; 80}\n\n# \u30ad\u30fc\u304c\u7701\u7565\u7cfb\nexam = {subject: \"Math\", score: 80}<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\uff1c\u3053\u306e\u8a18\u4e8b\u306f\u3053\u3093\u306a\u4eba\u306b\u304a\u3059\u3059\u3081\uff1e Ruby\u306e\u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u4eba \u30cf\u30c3\u30b7\u30e5\u306e\u4f7f\u3044\u65b9\u3084\u7701\u7565\u5f62\u3092\u77e5\u308a\u305f\u3044\u4eba Ruby\u5165\u9580\u8005 \uff1c\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068\uff1e \u30cf\u30c3\u30b7\u30e5\u306e\u66f8\u304d\u65b9 \u30cf\u30c3\u30b7\u30e5\u306e\u4f7f\u3044\u65b9 \u30cf\u30c3\u30b7\u30e5\u306e\u7701\u7565\u5f62 \u30cf\u30c3\u30b7\u30e5\u306b\u3064\u3044 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4559,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[272],"tags":[],"class_list":{"0":"post-4546","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-programing","8":"entry"},"_links":{"self":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/4546","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4546"}],"version-history":[{"count":3,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/4546\/revisions"}],"predecessor-version":[{"id":4563,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/4546\/revisions\/4563"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/media\/4559"}],"wp:attachment":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4546"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4546"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4546"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}