{"id":4468,"date":"2019-09-24T15:56:24","date_gmt":"2019-09-24T06:56:24","guid":{"rendered":"https:\/\/yumishin.com\/?p=4468"},"modified":"2019-09-24T15:56:24","modified_gmt":"2019-09-24T06:56:24","slug":"ruby-progate-5","status":"publish","type":"post","link":"https:\/\/yumishin.com\/?p=4468","title":{"rendered":"Ruby\u5165\u9580\uff5c\u6761\u4ef6\u5206\u5c90"},"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>\u6761\u4ef6\u5206\u5c90\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u4eba<\/li>\n<li>\u771f\u507d\u5024\u306b\u3064\u3044\u3066\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>\u6761\u4ef6\u5206\u5c90\u306e\u3084\u308a\u65b9<\/li>\n<li>\u771f\u507d\u5024\u306b\u3064\u3044\u3066<\/li>\n<li>\u4e0d\u7b49\u53f7\u3092\u4f7f\u3063\u305f\u5927\u5c0f\u6bd4\u8f03<\/li>\n<\/ul>\n<\/div>\n<h2 id=\"i-0\">\u6761\u4ef6\u5206\u5c90<\/h2>\n<h3 id=\"i-1\">if\u6587\u306e\u66f8\u304d\u65b9<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4471\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/09\/10.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<p><span style=\"color: #ff0000;\">\u6761\u4ef6\u5206\u5c90\u3059\u308b\u305f\u3081\u306eif\u6587\u3092\u4f7f\u3046\u3068\u300c\u3082\u3057\u3007\u3007\u306a\u3089\u3001\u3007\u3007\u3092\u884c\u3046\u300d\u3068\u3044\u3046\u3088\u3046\u306a\u3053\u3068\u304c\u53ef\u80fd\u306b\u306a\u308a\u307e\u3059\u3002<\/span>if\u6587\u3092\u7528\u3044\u308b\u4e0a\u3067\u306e\u57fa\u672c\u4e8b\u9805\u3092\u6b21\u306b\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>if\u6587\u306e\u5f8c\u306b\u6761\u4ef6\u5f0f\u3092\u66f8\u304d\u3001\u6210\u308a\u7acb\u3064\u5834\u5408\u306f\u51e6\u7406\u3092\u5b9f\u884c\u3059\u308b<\/li>\n<li>\u51e6\u7406\u306f\u300cif\u300d\u3068\u300cend\u300d\u3067\u56f2\u3080<\/li>\n<li>if\u306e\u6761\u4ef6\u304c\u6210\u308a\u7acb\u305f\u306a\u3051\u308c\u3070\u51e6\u7406\u306f\u5b9f\u884c\u3055\u308c\u306a\u3044<\/li>\n<\/ul>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u30b9\u30b3\u30a2\u306b\u300c45\u300d\u3092\u4ee3\u5165\u3057\u3066\u304a\u304d\u300180\u4ee5\u4e0a\u306a\u3089\u300c\u3088\u304f\u3067\u304d\u307e\u3057\u305f\u300d\u3068\u8868\u793a\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">score = 45\n\n# \u6761\u4ef6\u5f0f\u3092\u300cscore &gt; 80\u300d\u3068\u3059\u308bif\u6587\u3092\u3064\u304f\u3063\u3066\u304f\u3060\u3055\u3044\nif score &gt; 80\n  puts '\u3088\u304f\u3067\u304d\u307e\u3057\u305f'\nend<\/pre>\n<div class=\"sng-box box3\">\n<p>\u4eca\u56de\u306f\u30b9\u30b3\u30a2\u304c80\u4ee5\u4e0b\u306e\u305f\u3081if\u6587\u306e\u4e2d\u8eab\u306f\u5b9f\u884c\u3055\u308c\u305a\u3001\u4f55\u3082\u8868\u793a\u3055\u308c\u307e\u305b\u3093\u3002<\/p>\n<\/div>\n<h3 id=\"i-2\">\u771f\u507d\u5024<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4474\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/09\/d85e1ddbad72bc3be6143e875d8e7480-2.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<p><span style=\"color: #ff0000;\">if\u6587\u306b\u3064\u3051\u308b\u6761\u4ef6\u5f0f\u3067\u3059\u304c\u3001\u6761\u4ef6\u5f0f\u306b\u3042\u3063\u3066\u3044\u308b\u3068\u300ctrue\u300d\u3001\u6761\u4ef6\u5f0f\u3068\u53cd\u3059\u308b\u3068\u300cfalse\u300d\u306b\u306a\u308a\u307e\u3059\u3002<\/span>\u771f\u507d\u5024\u306e\u57fa\u672c\u4e8b\u9805\u306f\u4ee5\u4e0b\u306e\u901a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>\u771f\u507d\u5024\u306b\u306f\u300ctrue\u300d\u304b\u300cfalse\u300d\u306e2\u3064\u3057\u304b\u5b58\u5728\u3057\u306a\u3044<\/li>\n<li>\u6761\u4ef6\u5f0f\u306f\u6210\u308a\u7acb\u3064\u3068\u300ctrue\u300d\u3001\u6210\u308a\u7acb\u305f\u306a\u3044\u3068\u300cfalse\u300d<\/li>\n<\/ul>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u300cscore\u300d\u5909\u6570\u306b80\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u300280\u3088\u308a\u5927\u304d\u3044\u3068\u3044\u3046\u51e6\u7406\u306e\u5834\u5408\u306f\u300cfalse\u300d\u304c\u51fa\u529b\u3055\u308c\u3001\u9006\u306b80\u4ee5\u4e0b\u3068\u3044\u3046\u6761\u4ef6\u3060\u3068\u300ctrue\u300d\u304c\u51fa\u529b\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">score = 80\n\n# \u300cscore &gt; 80\u300d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs score &gt; 80\u3000#=&gt; false\n\n# \u300cscore &lt;= 80\u300d\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nputs score &lt;= 80 #=&gt; true<\/pre>\n<h3 id=\"i-3\">\u5927\u5c0f\u6bd4\u8f03<\/h3>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4473\" src=\"https:\/\/yumishin.com\/wp-content\/uploads\/2019\/09\/12.jpg\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<p><span style=\"color: #ff0000;\">if\u6587\u3092\u69cb\u6210\u3059\u308b\u6761\u4ef6\u5f0f\u306b\u306f\u3001\u4e0d\u7b49\u53f7\u3092\u4f7f\u3063\u305f\u3082\u306e\u304c\u51fa\u3066\u304d\u307e\u3059\u3002<\/span>\u3088\u304f\u4f7f\u3046\u3082\u306e\u3082\u6b21\u306b\u307e\u3068\u3081\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">a &lt; b  \u3000#a\u304cb\u3088\u308a\u5c0f\u3055\u3044\u3068true\na &lt;= b   #a\u304cb\u4ee5\u4e0b\u3060\u3068true\na &gt; b  \u3000#a\u304cb\u3088\u308a\u5927\u304d\u3044\u3068true\na &gt;= b\u3000\u3000#a\u304cb\u4ee5\u4e0a\u3060\u3068true\na == b\u3000\u3000#a\u3068b\u304c\u7b49\u3057\u3044\u3068true\na != b\u3000\u3000#a\u3068b\u304c\u7570\u306a\u308b\u3068true\n<\/pre>\n<p>\u6b21\u306e\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u30b9\u30b3\u30a2\u304c\u300c78\u300d\u3067\u6761\u4ef6\u5f0f\u304c\u300cscore &lt;= 80\u300d\u306e\u305f\u3081\u3001\u6761\u4ef6\u3092\u6e80\u305f\u3057\u307e\u3059\u3002\u3088\u3063\u3066if\u6587\u306e\u4e2d\u306e\u51e6\u7406\u304c\u5b9f\u884c\u3055\u308c\u3066\u3001\u300c\u9811\u5f35\u308a\u307e\u3057\u3087\u3046\u300d\u304c\u51fa\u529b\u3055\u308c\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">score = 78\n\n# score\u306e\u5024\u304c80\u4ee5\u4e0b\u306e\u5834\u5408\u306b\u3001\u300c\u304c\u3093\u3070\u308a\u307e\u3057\u3087\u3046\u300d\u3068\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\nif score &lt;=80\n  puts '\u9811\u5f35\u308a\u307e\u3057\u3087\u3046'\nend\n\n#=&gt; \u9811\u5f35\u308a\u307e\u3057\u3087\u3046<\/pre>\n<h2 id=\"i-4\">\u307e\u3068\u3081<\/h2>\n<p>\u3068\u3044\u3046\u308f\u3051\u3067\u6761\u4ef6\u5206\u5c90\u306b\u3064\u3044\u3066\u307e\u3068\u3081\u307e\u3057\u305f\u3002\u300c<span style=\"color: #ff0000;\">\u3082\u3057\u3007\u3007\u3057\u305f\u3089\u3001\u3007\u3007\u3092\u884c\u3046\u300d\u3068\u3044\u3046\u51e6\u7406\u3092\u884c\u3044\u305f\u3044\u5834\u5408\u306f\u3001\u6761\u4ef6\u5206\u5c90\u3092\u4f7f\u3044\u307e\u3059<\/span><span style=\"color: #ff0000;\">\u3002<\/span><\/p>\n<p>\u3082\u3057\u4eca\u56de\u306eif\u6587\u304c\u6210\u308a\u7acb\u305f\u306a\u304b\u3063\u305f\u6642\u306b\u3001\u5225\u306e\u51e6\u7406\u3092\u884c\u3046\u65b9\u6cd5\u304c\u3042\u308b\u306e\u3067\u305d\u308c\u306b\u3064\u3044\u3066\u306f\u5225\u306e\u8a18\u4e8b\u3067\u307e\u3068\u3081\u3066\u304a\u304d\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uff1c\u3053\u306e\u8a18\u4e8b\u306f\u3053\u3093\u306a\u4eba\u306b\u304a\u3059\u3059\u3081\uff1e \u6761\u4ef6\u5206\u5c90\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u4eba \u771f\u507d\u5024\u306b\u3064\u3044\u3066\u77e5\u308a\u305f\u3044\u4eba Ruby\u5165\u9580\u8005 \uff1c\u3053\u306e\u8a18\u4e8b\u3067\u308f\u304b\u308b\u3053\u3068\uff1e \u6761\u4ef6\u5206\u5c90\u306e\u3084\u308a\u65b9 \u771f\u507d\u5024\u306b\u3064\u3044\u3066 \u4e0d\u7b49\u53f7\u3092\u4f7f\u3063\u305f\u5927\u5c0f\u6bd4\u8f03 \u6761\u4ef6\u5206\u5c90 if\u6587\u306e\u66f8\u304d\u65b9 \u6761\u4ef6\u5206 &#8230; <\/p>\n","protected":false},"author":1,"featured_media":4470,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[272],"tags":[],"class_list":{"0":"post-4468","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\/4468","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=4468"}],"version-history":[{"count":3,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/4468\/revisions"}],"predecessor-version":[{"id":4476,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/posts\/4468\/revisions\/4476"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=\/wp\/v2\/media\/4470"}],"wp:attachment":[{"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yumishin.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}