{"id":2973,"date":"2021-11-17T03:04:14","date_gmt":"2021-11-16T18:04:14","guid":{"rendered":"https:\/\/suzutukiblog.com\/?p=2973"},"modified":"2022-01-22T06:04:28","modified_gmt":"2022-01-21T21:04:28","slug":"rails-tutorial4-5","status":"publish","type":"post","link":"https:\/\/suzutukiblog.com\/index.php\/2021\/11\/17\/rails-tutorial4-5\/","title":{"rendered":"Rails-tutorial\u81ea\u5206\u7528\u307e\u3068\u3081(4.5 Ruby\u306b\u3064\u3044\u3066)"},"content":{"rendered":"<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/01\/18\/rails-tutorial-4\/\">\u305d\u306e4\u304b\u3089\u7d9a\u304d\u307e\u3059<\/a><\/p>\n<h3>4.3.1 \u914d\u5217\u3068\u7bc4\u56f2\u6f14\u7b97\u5b50<\/h3>\n<p>\u914d\u5217\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u3084Rails\u306e\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u57fa\u76e4<br \/>\nsplit\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u6587\u5b57\u5217\u3092\u81ea\u7136\u306b\u5909\u63db\u3057\u305f\u914d\u5217\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; \"foo bar baz\".split<\/strong>\r\n<strong>=&gt; [\"foo\", \"bar\", \"baz\"]<\/strong>\r\n<strong>&gt;&gt; \"fooxbarxbaz\".split('x')<\/strong>\r\n<strong>=&gt; [\"foo\", \"bar\", \"baz\"]<\/strong><\/pre>\n<p>\u591a\u304f\u306e\u30b3\u30f3\u30d4\u30e5\u30fc\u30bf\u8a00\u8a9e\u306e\u6163\u7fd2\u3068\u540c\u69d8\u3001Ruby\u306e\u914d\u5217\u3067\u3082\u30bc\u30ed\u30aa\u30ea\u30b8\u30f3\u3092<br \/>\n\u63a1\u7528\u3057\u3066\u3044\u307e\u3059\u3002\u3053\u308c\u306f\u3001\u914d\u5217\u306e\u6700\u521d\u306e\u8981\u7d20\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u304c0\u304b\u3089\u59cb\u307e\u308a\u3001<br \/>\n2\u756a\u76ee\u306f1&#8230;\u3068\u7d9a\u304f\u3053\u3068\u3092\u610f\u5473\u3057\u307e\u3059\u3002\u6dfb\u5b57\u306e\u3053\u3068<\/p>\n<pre><strong>a = [42, 8, 17]<\/strong>\r\n<strong>&gt;&gt; a[-1] =&gt; 17 # \u914d\u5217\u306e\u6dfb\u5b57\u306f\u30de\u30a4\u30ca\u30b9\u306b\u3082\u306a\u308c\u308b!<\/strong>\r\n<strong>&gt;&gt; a.last === a[-1]<\/strong>\r\n<strong>=&gt; true<\/strong><\/pre>\n<p>\u914d\u5217\u306e\u8981\u7d20\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u89d2\u30ab\u30c3\u30b3[]!<br \/>\n\u914d\u5217\u306e\u5185\u5bb9\u3092\u5909\u66f4\u3057\u305f\u3044\u5834\u5408\u306f\u3001<br \/>\n\u305d\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u5bfe\u5fdc\u3059\u308b\u300c\u7834\u58ca\u7684\u300d\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; a<\/strong>\r\n<strong>=&gt; [42, 8, 17]<\/strong>\r\n<strong>&gt;&gt; a.sort!<\/strong>\r\n<strong>=&gt; [8, 17, 42]<\/strong>\r\n<strong>&gt;&gt; a<\/strong>\r\n<strong>=&gt; [8, 17, 42]<\/strong><\/pre>\n<p>push\u30e1\u30bd\u30c3\u30c9 (\u307e\u305f\u306f\u540c\u7b49\u306e&lt;&lt;\u6f14\u7b97\u5b50) \u3092\u4f7f\u3063\u3066\u914d\u5217\u306b\u8981\u7d20\u3092\u8ffd\u52a0\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>a.push(6)=&gt;[42, 8, 17, 6]<\/strong>\r\n<strong>&gt;&gt; a &lt;&lt; \"foo\" &lt;&lt; \"bar\"<\/strong> # \u914d\u5217\u306b\u9023\u7d9a\u3057\u3066\u8ffd\u52a0\u3059\u308b\r\n<strong>=&gt; [42, 8, 17, 6, 7, \"foo\", \"bar\"]<\/strong><\/pre>\n<p>Ruby\u3067\u306f\u7570\u306a\u308b\u578b\u304c\u914d\u5217\u306e\u4e2d\u3067\u5171\u5b58\u3067\u304d\u308b(\u4e0a\u306e\u5834\u5408\u306f\u6574\u6570\u3068\u6587\u5b57\u5217)\u3002<br \/>\n\u6587\u5b57\u5217\u3092\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u306e\u306bsplit\u3092\u4f7f\u3044\u307e\u3057\u305f\u3002<br \/>\njoin\u30e1\u30bd\u30c3\u30c9\u306f\u3053\u308c\u3068\u9006\u306e\u52d5\u4f5c\u3067\u6587\u5b57\u3092\u9023\u7d50\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; a<\/strong>\r\n<strong>=&gt; [8, 17, 42, 6, 7, \"foo\", \"var\"]<\/strong>\r\n<strong>&gt;&gt; a.join<\/strong>\r\n<strong>=&gt; \"8174267foovar\"<\/strong>\r\n<strong>&gt;&gt; a.join(',')<\/strong>\r\n<strong>=&gt; \"8,17,42,6,7,foo,var\"<\/strong><\/pre>\n<p>\u7bc4\u56f2 (range) \u306f\u3001\u914d\u5217\u3068\u5bc6\u63a5\u306b\u95a2\u4fc2\u3057\u3066\u3044\u307e\u3059\u3002to_a\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066<br \/>\n\u914d\u5217\u306b\u5909\u63db\u3059\u308b\u3068\u7406\u89e3\u3057\u3084\u3059\u3044\u3067\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; 0..9<\/strong>\r\n<strong>=&gt; 0..9<\/strong>\r\n<strong>&gt;&gt; (0..9).to_a<\/strong>\r\n<strong>=&gt; [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<\/strong><\/pre>\n<pre><strong>&gt;&gt; a = %w[foo bar baz quux] # %w\u3092\u4f7f\u3063\u3066\u6587\u5b57\u5217\u306e\u914d\u5217\u306b\u5909\u63db<\/strong>\r\n<strong>=&gt; [\"foo\", \"bar\", \"baz\", \"quux\"]<\/strong>\r\n<strong>&gt;&gt; a[0..2]<\/strong>\r\n<strong>=&gt; [\"foo\", \"bar\", \"baz\"]<\/strong><\/pre>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306b-1\u3068\u3044\u3046\u5024\u3092\u6307\u5b9a\u3067\u304d\u308b\u306e\u306f\u6975\u3081\u3066\u4fbf\u5229\u3002-1\u3092\u4f7f\u3046\u3068\u3001<br \/>\n\u914d\u5217\u306e\u9577\u3055\u3092\u77e5\u3089\u306a\u304f\u3066\u3082\u914d\u5217\u306e\u6700\u5f8c\u306e\u8981\u7d20\u3092\u6307\u5b9a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u3001<br \/>\n\u3053\u308c\u306b\u3088\u308a\u914d\u5217\u3092\u7279\u5b9a\u306e\u958b\u59cb\u4f4d\u7f6e\u306e\u8981\u7d20\u304b\u3089\u6700\u5f8c\u306e\u8981\u7d20\u307e\u3067\u3092\u4e00\u5ea6\u306b<br \/>\n\u9078\u629e\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<\/p>\n<pre><strong>&gt;&gt; a = (0..9).to_a<\/strong>\r\n<strong>=&gt; [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<\/strong>\r\n<strong>&gt;&gt; a[2..(a.length-1)] # \u660e\u793a\u7684\u306b\u914d\u5217\u306e\u9577\u3055\u3092\u4f7f\u3063\u3066\u9078\u629e<\/strong>\r\n<strong>=&gt; [2, 3, 4, 5, 6, 7, 8, 9]<\/strong>\r\n<strong>&gt;&gt; a[2..-1] # \u6dfb\u5b57\u306b-1\u3092\u4f7f\u3063\u3066\u9078\u629e<\/strong>\r\n<strong>=&gt; [2, 3, 4, 5, 6, 7, 8, 9]<\/strong><\/pre>\n<p>\u5b57\u5217\u306b\u5bfe\u3057\u3066\u3082\u7bc4\u56f2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u304c\u4f7f\u3048\u308b\u3002<\/p>\n<pre><strong>&gt;&gt; ('a'..'e').to_a<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\", \"d\", \"e\"]<\/strong><\/pre>\n<h2>\u6f14\u7fd2<\/h2>\n<h3>1:\u6587\u5b57\u5217\u300cA man, a plan, a canal, Panama\u300d\u3092 &#8220;, &#8221; \u3067\u5206\u5272\u3057\u3066<br \/>\n\u914d\u5217\u306b\u3057\u3001\u5909\u6570a\u306b\u4ee3\u5165\u3057\u3066\u307f\u3066\u3002<\/h3>\n<p><!--more--><\/p>\n<pre><strong>a = \"A man, a plan, a canal, Panama\".split(', ')<\/strong><\/pre>\n<h3>2:\u4eca\u5ea6\u306f\u3001\u5909\u6570a\u306e\u8981\u7d20\u3092\u9023\u7d50\u3057\u305f\u7d50\u679c (\u6587\u5b57\u5217) \u3092\u3001\u5909\u6570s\u306b\u4ee3\u5165\u3057\u3066<br \/>\n\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<pre><strong>s = a.join<\/strong>\r\n<strong>=&gt; \"A mana plana canalPanama\"<\/strong><\/pre>\n<h3>3:\u5909\u6570s\u3092\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u3067\u5206\u5272\u3057\u305f\u5f8c\u3001\u3082\u3046\u4e00\u5ea6\u9023\u7d50\u3057\u3066\u6587\u5b57\u5217\u306b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u56de\u6587\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u3001\u5909\u6570s\u304c\u56de\u6587\u3067\u306f\u306a\u3044\u3053\u3068\u3092\u78ba\u8a8d\u3002<br \/>\ndowncase\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u3001s.downcase\u306f\u56de\u6587\u3067\u3042\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<pre><strong>&gt; s.gsub!(\" \",\"\")<\/strong>\r\n<strong>=&gt; \"AmanaplanacanalPanama\"<\/strong><\/pre>\n<p>gsub\u306f\u7b2c1\u5f15\u6570\u3067\u6307\u5b9a\u3057\u305f\u3082\u306e\u3092\u7b2c2\u5f15\u6570\u3067\u5168\u3066\u7f6e\u304d\u63db\u3048\u308b\u3002\u30b9\u30da\u30fc\u30b9\u3092\u300c\u7121\u300d\u306b\u3057\u305f\u3068\u3044\u3046\u3053\u3068<\/p>\n<pre><strong>def palindrome_tester(s)<\/strong>\r\n<strong>  if s == s.reverse<\/strong>\r\n<strong>    puts \"It's a palindrome!\"<\/strong>\r\n<strong>  else<\/strong>\r\n<strong>    puts \"It's not a palindrome.\"<\/strong>\r\n<strong>  end<\/strong>\r\n<strong>end<\/strong>\r\n<strong>:palindrome_tester<\/strong>\r\n<strong>palindrome_tester(s)<\/strong>\r\n\r\n<strong>s.downcase!<\/strong>\r\n\r\n<strong>def palindrome_tester(s = \"amanaplanacanalpanama\" )<\/strong>\r\n<strong>  if s == s.reverse<\/strong>\r\n<strong>    puts \"It's a palindrome!\"<\/strong>\r\n<strong>  else<\/strong>\r\n<strong>    puts \"It's not a palindrome.\"<\/strong>\r\n<strong>  end<\/strong>\r\n<strong>end<\/strong>\r\n<strong>palindrome_tester<\/strong>\r\n\r\n<strong>\u5225\u89e3\r\ndef palindrome_tester(s)<\/strong>\r\n<strong>  if s == s.reverse<\/strong>\r\n<strong>    puts \"It's a palindrome!\"<\/strong>\r\n<strong>  else<\/strong>\r\n<strong>    puts \"It's not a palindrome.\"<\/strong>\r\n<strong> end<\/strong>\r\n<strong>end<\/strong>\r\n<strong>:palindrome_tester<\/strong>\r\n<strong>palindrome_tester(s.gsub(\" \",\"\").downcase)<\/strong>\r\n\r\n<strong>\u66f4\u306b\u5225\u89e3<\/strong>\r\n<strong>def palindrome_tester(s)<\/strong>\r\n<strong>  if s == s.reverse<\/strong>\r\n<strong>    puts \"It's a palindrome!\"<\/strong>\r\n<strong>  else<\/strong>\r\n<strong>    puts \"It's not a palindrome.\"<\/strong>\r\n<strong>  end<\/strong>\r\n<strong>end<\/strong>\r\n<strong>:palindrome_tester<\/strong>\r\n<strong>puts palindrome_tester(s.split.join.downcase)<\/strong><\/pre>\n<h3>4:a\u304b\u3089z\u307e\u3067\u306e\u7bc4\u56f2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3057\u30017\u756a\u76ee\u306e\u8981\u7d20\u3092\u53d6\u308a\u51fa\u3057\u3066<br \/>\n\u307f\u3066\u304f\u3060\u3055\u3044\u3002\u540c\u69d8\u306b\u3057\u3066\u3001\u5f8c\u308d\u304b\u3089\uff17\u756a\u76ee\u306e\u8981\u7d20\u3092\u53d6\u308a\u51fa\u3057\u3066\u307f\u3066\u3002<\/h3>\n<pre><strong>f = ('a'..'z').to_a<\/strong>\r\n<strong>f[6]<\/strong>\r\n<strong>f[-7]<\/strong><\/pre>\n<h3>4.3.2 \u30d6\u30ed\u30c3\u30af<\/h3>\n<p>\u914d\u5217\u3068\u7bc4\u56f2\u306f\u3044\u305a\u308c\u3082\u3001\u30d6\u30ed\u30c3\u30af\u3092\u4f34\u3046\u3055\u307e\u3056\u307e\u306a\u30e1\u30bd\u30c3\u30c9\u306b\u5bfe\u3057\u3066<br \/>\n\u5fdc\u7b54\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u30d6\u30ed\u30c3\u30af\u306f\u3001Ruby\u306e\u6975\u3081\u3066\u5f37\u529b\u306a\u6a5f\u80fd\u3067\u3042\u308a\u3001<br \/>\n\u304b\u3064\u308f\u304b\u308a\u306b\u304f\u3044\u6a5f\u80fd\u3067\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; (1..5).each { |i| puts 2 * i }<\/strong>\r\n<strong>2<\/strong>\r\n<strong>4<\/strong>\r\n<strong>6<\/strong>\r\n<strong>8<\/strong>\r\n<strong>10<\/strong>\r\n<strong>=&gt; 1..5<\/strong><\/pre>\n<p>\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u3066\u3044\u308b<strong>{ |i| puts 2 * i }<\/strong>\u304c\u3001\u30d6\u30ed\u30c3\u30af\u3068\u547c\u3070\u308c\u308b\u90e8\u5206<\/p>\n<pre><strong>(1..5).each do |i|<\/strong>\r\n<strong>?&gt; puts 2*i<\/strong>\r\n<strong>&gt;&gt; end<\/strong>\r\n<strong>2<\/strong>\r\n<strong>4<\/strong>\r\n<strong>6<\/strong>\r\n<strong>8<\/strong>\r\n<strong>10<\/strong>\r\n<strong>=&gt; 1..5<\/strong><\/pre>\n<p>\u4e21\u65b9\u540c\u3058\u610f\u5473<\/p>\n<p>\u30d6\u30ed\u30c3\u30af\u306b\u306f\u8907\u6570\u306e\u884c\u3092\u8a18\u8ff0\u3067\u304d\u308b\u3088(\u5b9f\u969b\u307b\u3068\u3093\u3069\u306e\u30d6\u30ed\u30c3\u30af\u306f\u8907\u6570\u884c)\u3002<br \/>\nRails\u30c1\u30e5\u30fc\u30c8\u30ea\u30a2\u30eb\u3067\u306fRuby\u5171\u901a\u306e\u6163\u7fd2\u306b\u5f93\u3063\u3066\u3001\u77ed\u30441\u884c\u306e\u30d6\u30ed\u30c3\u30af\u306b\u306f\u6ce2\u30ab\u30c3\u30b3\u3092\u4f7f\u3044\u3001\u9577\u30441\u884c\u3084\u8907\u6570\u884c\u306e\u30d6\u30ed\u30c3\u30af\u306b\u306fdo..end\u8a18\u6cd5\u3092\u4f7f\u3063\u3066\u3044\u308b\u3002<\/p>\n<pre><strong>&gt;&gt; (1..5).each do |number|<\/strong>\r\n<strong>?&gt; puts 2 * number<\/strong>\r\n<strong>&gt;&gt; puts '--'<\/strong>\r\n<strong>&gt;&gt; end<\/strong>\r\n<strong>2<\/strong>\r\n<strong>--<\/strong>\r\n<strong>4<\/strong>\r\n<strong>--<\/strong>\r\n<strong>6<\/strong>\r\n<strong>--<\/strong>\r\n<strong>8<\/strong>\r\n<strong>--<\/strong>\r\n<strong>10<\/strong>\r\n<strong>--<\/strong>\r\n<strong>=&gt; 1..5<\/strong><\/pre>\n<p>\u4eca\u5ea6\u306fi\u306e\u4ee3\u308f\u308a\u306bnumber\u3092\u4f7f\u3063\u3066\u3044\u308b\u3053\u3068\u306b\u6ce8\u76ee\u3002<br \/>\n\u3053\u306e\u5909\u6570(\u30d6\u30ed\u30c3\u30af\u5909\u6570) \u306e\u540d\u524d\u306f\u56fa\u5b9a\u3055\u308c\u3066\u3044\u306a\u3044\u3002<br \/>\n\u30d6\u30ed\u30c3\u30af\u306f\u898b\u305f\u76ee\u306b\u53cd\u3057\u3066\u5965\u304c\u6df1\u304f\u3001\u30d6\u30ed\u30c3\u30af\u3092\u5341\u5206\u306b\u7406\u89e3\u3059\u308b\u305f\u3081\u306b\u306f<br \/>\n\u76f8\u5f53\u306a\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u7d4c\u9a13\u304c\u5fc5\u8981\u3067\u3059\u3002<\/p>\n<p>\u53c2\u8003\u306e\u305f\u3081\u3001map\u30e1\u30bd\u30c3\u30c9\u306a\u3069\u3092\u4f7f\u3063\u305f\u30d6\u30ed\u30c3\u30af\u306e\u4f7f\u7528\u4f8b\u3092\u3044\u304f\u3064\u304b\u6319\u3052\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u30d6\u30ed\u30c3\u30af\u3068\u306f\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u3066\u3044\u308b\uff5b\u3068\u4e2d\u8eab\uff5d\u304c\u30d6\u30ed\u30c3\u30af\u3068\u547c\u3070\u308c\u308b\u90e8\u5206\u3067\u3059\u3002<br \/>\ndo..end\u306e\u9593\u3082\u30d6\u30ed\u30c3\u30af\u3068\u547c\u3070\u308c\u308b|i|\u3088\u3046\u306b\uff5c\u3067\u56f2\u307e\u308c\u3066\u3044\u308b\u3082\u306e\u3092<br \/>\n\u30d6\u30ed\u30c3\u30af\u5909\u6570\u3068\u3082\u3044\u3046\u3002<br \/>\n\u6163\u7fd2\u7684\u306b\u77ed\u30441\u884c\u306e\u5834\u5408\u306f\u6ce2\u304b\u3063\u3053\u3092\u4f7f\u3063\u3066<br \/>\n\u8907\u6570\u884c\u306e\u5834\u5408\u306feach do..end\u306e\u3088\u3046\u306b\u8907\u6570\u884c\u306b\u307e\u305f\u304c\u3063\u3066\u8a18\u8ff0\u3055\u308c\u308b\u3002<\/p>\n<pre><strong>&gt;&gt; 3.times { puts \"Betelgeuse!\" }<\/strong>\r\n<strong>\"Betelgeuse!\" # 3.times\u3067\u306f\u30d6\u30ed\u30c3\u30af\u306b\u5909\u6570\u3092\u4f7f\u3063\u3066\u3044\u306a\u3044<\/strong>\r\n<strong>\"Betelgeuse!\"<\/strong>\r\n<strong>\"Betelgeuse!\"<\/strong>\r\n<strong>=&gt; 3\r\n&gt;&gt; (1..5).map { |i| i**2 } # \u300c**\u300d\u8a18\u6cd5\u306f\u51aa\u4e57 (\u3079\u304d\u4e57)<\/strong>\r\n<strong>=&gt; [1, 4, 9, 16, 25]<\/strong><\/pre>\n<p>map\u30e1\u30bd\u30c3\u30c9\u306f\u3001\u6e21\u3055\u308c\u305f\u30d6\u30ed\u30c3\u30af(1..5)\u3092\u914d\u5217\u3084\u7bc4\u56f2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u306e<br \/>\n\u5404\u8981\u7d20\u306b{ |i| i**2 } \u5bfe\u3057\u3066\u9069\u7528\u3057\u3001\u7d50\u679c\u3092\u8fd4\u3059\u3002[1, 4, 9, 16, 25]<\/p>\n<pre><strong>&gt;&gt; %w[a b c] # %w \u3067\u6587\u5b57\u5217\u306e\u914d\u5217\u3092\u4f5c\u6210<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong>\r\n<strong>&gt;&gt; %w[a b c].map { |char| char.upcase }<\/strong>\r\n<strong>=&gt; [\"A\", \"B\", \"C\"]<\/strong>\r\n<strong>&gt;&gt; %w[A B C].map { |char| char.downcase }<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong><\/pre>\n<p>\u2191\u306e2\u3064\u306e\u4f8b\u3067\u306f\u3001map\u306e\u30d6\u30ed\u30c3\u30af\u5185\u3067\u5ba3\u8a00\u3057\u305f\u5f15\u6570(char)\u306b\u5bfe\u3057\u3066<br \/>\n\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3073\u51fa\u3057\u3066\u308b\u3088\u3002\u3053\u3046\u3044\u3063\u305f\u30b1\u30fc\u30b9\u3067\u306f\u7701\u7565\u8a18\u6cd5\u304c\u4e00\u822c\u7684\u3067\u3001<br \/>\n\u6b21\u306e\u3088\u3046\u306b\u66f8\u304f\u3053\u3068\u3082\u3067\u304d\u308b(\u3053\u306e\u8a18\u6cd5\u3092\u201csymbol-to-proc\u201d\u3068\u547c\u3076)\u3002<\/p>\n<pre><strong>a = [\"A\", \"B\", \"C\"]<\/strong>\r\n<strong>&gt;&gt; a.map { |cha| cha.downcase}<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong><\/pre>\n<p>\u307e\u3042\u3088\u3046\u3059\u308b\u306b\u3053\u3046\u3044\u3046\u3053\u3068<\/p>\n<pre><strong>&gt;&gt; %w[A B C].map { |char| char.downcase }<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong>\r\n<strong>&gt;&gt; %w[A B C].map(&amp;:downcase)<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong><\/pre>\n<p>Ruby on Rails\u72ec\u81ea\u306e\u8a18\u6cd5\u3060\u3063\u305f\u3051\u3069\u3082\u591a\u304f\u306e\u4eba\u304c\u3053\u306e\u8a18\u6cd5\u3092\u597d\u3080\u3088\u3046<br \/>\n\u306b\u306a\u3063\u305f\u306e\u3067\u3001\u4eca\u3067\u306fRuby\u306e\u30b3\u30a2\u6a5f\u80fd\u3068\u3057\u3066\u9006\u8f38\u5165\u3055\u308c\u3066\u3044\u308b\u3088\u3002<br \/>\n\u30d6\u30ed\u30c3\u30af\u306e\u4f8b\u3068\u3057\u3066\u3001\u5358\u4f53\u30c6\u30b9\u30c8\u306b\u3082\u76ee\u3092\u5411\u3051\u3066\u307f\u3088\u3046<\/p>\n<pre><strong>test \"should get home\" do<\/strong>\r\n<strong>  get static_pages_home_url<\/strong>\r\n<strong>  assert_response :success<\/strong>\r\n<strong>  assert_select \"title\", \"Ruby on Rails Tutorial Sample App\"<\/strong>\r\n<strong>end<\/strong><\/pre>\n<p>\u30c6\u30b9\u30c8\u30b3\u30fc\u30c9\u306bdo\u3068\u3044\u3046\u30ad\u30fc\u30ef\u30fc\u30c9\u304c\u3042\u308b\u3053\u3068\u306b\u6c17\u4ed8\u304d\u3001\u305d\u3053\u304b\u3089\u30c6\u30b9\u30c8\u306e<br \/>\n\u672c\u4f53\u304c\u300c\u305d\u3082\u305d\u3082\u30d6\u30ed\u30c3\u30af\u3067\u3067\u304d\u3066\u3044\u308b\u300d\u3053\u3068\u306b\u6c17\u4ed8\u304f\u3053\u3068\u3067<br \/>\n\u3053\u306etest\u30e1\u30bd\u30c3\u30c9\u306f\u6587\u5b57\u5217 (\u8aac\u660e\u6587) &#8220;should get home&#8221;\u3068\u30d6\u30ed\u30c3\u30af\u3092\u5f15\u6570\u306b\u3068\u308a\u3001<br \/>\n\u30c6\u30b9\u30c8\u304c\u5b9f\u884c\u3055\u308c\u308b\u3068\u304d\u306b\u30d6\u30ed\u30c3\u30af\u5185\u306e\u6587\u304c\u5b9f\u884c\u3055\u308c\u308b\u3001\u3068\u3044\u3046\u3053\u3068\u304c\u7406\u89e3\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u2193\u306e\u610f\u5473\u3092\u8aac\u660e\u305b\u3088<br \/>\n<strong>(&#8216;a&#8217;..&#8217;z&#8217;).to_a.shuffle[0..7].join<\/strong><\/p>\n<h2>\u6f14\u7fd2<\/h2>\n<h3>1\uff1a\u7bc4\u56f2\u30aa\u30d6\u30b8\u30a7\u30af\u30c80..16\u3092\u4f7f\u3063\u3066\u3001\u5404\u8981\u7d20\u306e\uff12\u4e57\u3092\u51fa\u529b\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/h3>\n<pre><strong>(0..16).map{ |i| i**2 }<\/strong><\/pre>\n<p>2\uff1ayeller (\u5927\u58f0\u3067\u53eb\u3076) \u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3057\u3066\u3002\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f<br \/>\n\u6587\u5b57\u5217\u306e\u8981\u7d20\u3067\u69cb\u6210\u3055\u308c\u305f\u914d\u5217\u3092\u53d7\u3051\u53d6\u308a\u3001\u5404\u8981\u7d20\u3092\u9023\u7d50\u3057\u305f\u5f8c\u3001<br \/>\n\u5927\u6587\u5b57\u306b\u3057\u3066\u7d50\u679c\u3092\u8fd4\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070yeller([&#8216;o&#8217;, &#8216;l&#8217;, &#8216;d&#8217;])<br \/>\n\u3068\u5b9f\u884c\u3057\u305f\u3068\u304d\u3001&#8221;OLD&#8221;\u3068\u3044\u3046\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304f\u308c\u3070\u6210\u529f\u3067\u3059\u3002<br \/>\n\u30d2\u30f3\u30c8: map\u3068upcase\u3068join\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3063\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p>map\u306a\u3057\u3067\u3084\u3063\u3066\u307f\u308b\u3068<\/p>\n<pre><strong>def yeller(a)<\/strong>\r\n<strong>  a.join.upcase<\/strong>\r\n<strong>end\r\n<\/strong>\r\n<strong>puts yeller(['o', 'l', 'd'])<\/strong><\/pre>\n<p>\u6ce8\u610f\uff01\u5148\u306bjoin\u3092\u66f8\u304b\u306a\u3044\u3068old\u306b\u306a\u3089\u306a\u3044\u306e\u3067\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>map\u3042\u308a\u3060\u3068<\/p>\n<pre><strong>def yeller(a)<\/strong>\r\n<strong>a.map(&amp;:upcase).join<\/strong>\r\n<strong>end<\/strong>\r\n<strong>puts yeller(['o', 'l', 'd'])<\/strong><\/pre>\n<pre><strong>OLD<\/strong>\r\n<strong>&gt;&gt; %w[A B C].map { |char| char.downcase }<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]<\/strong>\r\n<strong>&gt;&gt; %w[A B C].map(&amp;:downcase)<\/strong>\r\n<strong>=&gt; [\"a\", \"b\", \"c\"]s<\/strong><\/pre>\n<h3>3\uff1arandom_subdomain\u3068\u3044\u3046\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u30e9\u30f3\u30c0\u30e0\u306a8\u6587\u5b57\u3092\u751f\u6210\u3057\u3001\u6587\u5b57\u5217\u3068\u3057\u3066\u8fd4\u3057\u307e\u3059\u3002<\/h3>\n<pre><strong>('a'..'z').to_a.shuffle[0..7].join<\/strong><\/pre>\n<p>4\uff1a\u300c?\u300d\u306e\u90e8\u5206\u3092\u3001\u305d\u308c\u305e\u308c\u9069\u5207\u306a\u30e1\u30bd\u30c3\u30c9\u306b\u7f6e\u304d\u63db\u3048\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u30d2\u30f3\u30c8:split\u3001shuffle\u3001join\u30e1\u30bd\u30c3\u30c9\u3092\u7d44\u307f\u5408\u308f\u305b\u308b\u3068\u3001<br \/>\n\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u305f\u6587\u5b57\u5217 (\u5f15\u6570) \u3092\u30b7\u30e3\u30c3\u30d5\u30eb\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>def string_shuffle(s)<\/strong>\r\n<strong>  s.?('').?.?<\/strong>\r\n<strong>end<\/strong>\r\n<strong>\r\nputs string_shuffle(\"foobar\")<\/strong>\r\n<strong>\"oobfra\"<\/strong>\r\n\r\n<strong>#\u7b54\u3048\r\nsplit,shuffle,join<\/strong><\/pre>\n<p>\u30cf\u30c3\u30b7\u30e5\u306f\u672c\u8cea\u7684\u306b\u306f\u914d\u5217\u3068\u540c\u3058\u3067\u3059\u304c\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3068\u3057\u3066\u6574\u6570\u5024\u4ee5\u5916\u306e\u3082\u306e\u3082\u4f7f\u3048\u308b\u70b9\u304c\u914d\u5217\u3068\u7570\u306a\u308a\u307e\u3059 (Perl\u306a\u3069\u306e\u3044\u304f\u3064\u304b\u306e\u8a00\u8a9e\u3067\u306f\u30cf\u30c3\u30b7\u30e5\u3092\u9023\u60f3\u914d\u5217\u3068\u547c\u3076\u3053\u3068\u3082\u3042\u308a\u307e\u3059)\u3002<br \/>\n\u30cf\u30c3\u30b7\u30e5\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9 (\u30ad\u30fc\u3068\u547c\u3076\u306e\u304c\u666e\u901a\u3067\u3059)\u306f\u3001<br \/>\n\u901a\u5e38\u4f55\u3089\u304b\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u6587\u5b57\u5217\u3092\u30ad\u30fc\u3068\u3057\u3066\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; user = {} # {}\u306f\u7a7a\u306e\u30cf\u30c3\u30b7\u30e5<\/strong>\r\n<strong>=&gt; {}<\/strong>\r\n<strong>&gt;&gt; user[\"first_name\"] = \"Michael\" # \u30ad\u30fc\u304c \"first_name\" \u3067\u5024\u304c \"Michael\"<\/strong>\r\n<strong>=&gt; \"Michael\"<\/strong>\r\n<strong>&gt;&gt; user[\"last_name\"] = \"Hartl\" # \u30ad\u30fc\u304c \"last_name\" \u3067\u5024\u304c \"Hartl\"<\/strong>\r\n<strong>=&gt; \"Hartl\"<\/strong>\r\n<strong>&gt;&gt; user[\"first_name\"] # \u8981\u7d20\u3078\u306e\u30a2\u30af\u30bb\u30b9\u306f\u914d\u5217\u306e\u5834\u5408\u3068\u4f3c\u3066\u3044\u308b<\/strong>\r\n<strong>=&gt; \"Michael\"<\/strong>\r\n<strong>&gt;&gt; user # \u30cf\u30c3\u30b7\u30e5\u306e\u30ea\u30c6\u30e9\u30eb\u8868\u8a18<\/strong>\r\n<strong>=&gt; {\"last_name\"=&gt;\"Hartl\", \"first_name\"=&gt;\"Michael\"}<\/strong><\/pre>\n<p><strong>4.3.3 \u30cf\u30c3\u30b7\u30e5\u3068\u30b7\u30f3\u30dc\u30eb<\/strong><\/p>\n<p>\u30cf\u30c3\u30b7\u30e5\u306f\u3001\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3092\u6ce2\u30ab\u30c3\u30b3\u3067\u56f2\u3093\u3067\u8868\u8a18\u3057\u307e\u3059\u3002<br \/>\n\u30ad\u30fc\u3068\u5024\u306e\u30da\u30a2\u3092\u6301\u305f\u306a\u3044\u6ce2\u30ab\u30c3\u30b3\u306e\u7d44 ({}) \u306f\u7a7a\u306e\u30cf\u30c3\u30b7\u30e5\u3067\u3001<br \/>\n\u30cf\u30c3\u30b7\u30e5\u306e\u6ce2\u30ab\u30c3\u30b3\u306f\u3001\u30d6\u30ed\u30c3\u30af\u306e\u6ce2\u30ab\u30c3\u30b3\u3068\u306f\u307e\u3063\u305f\u304f\u5225\u7269\u3067\u3042\u308b\u3068\u3044\u3046\u70b9<br \/>\n\u30cf\u30c3\u30b7\u30e5\u306f\u914d\u5217\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u30011\u3064\u306e\u91cd\u8981\u306a\u9055\u3044\u3068\u3057\u3066\u3001\u30cf\u30c3\u30b7\u30e5\u3067\u306f\u8981\u7d20\u306e<br \/>\n\u300c\u4e26\u3073\u9806\u300d\u304c\u4fdd\u8a3c\u3055\u308c\u306a\u3044\u3068\u3044\u3046\u70b9\u304c\u3042\u308b\u3002\u3082\u3057\u8981\u7d20\u306e\u9806\u5e8f\u304c\u91cd\u8981\u3067\u3042\u308b\u5834\u5408\u306f\u3001<br \/>\n\u914d\u5217\u3092\u4f7f\u3046\u5fc5\u8981\u304c\u3042\u308b\u3088\u3002<\/p>\n<p>\u30cf\u30c3\u30b7\u30e5\u306e1\u8981\u7d20\u3092\u89d2\u30ab\u30c3\u30b3\u3092\u4f7f\u3063\u3066\u5b9a\u7fa9\u3059\u308b\u4ee3\u308f\u308a\u306b\u3001\u6b21\u306e\u3088\u3046\u306b\u30ad\u30fc\u3068\u5024\u3092<br \/>\n\u30cf\u30c3\u30b7\u30e5\u30ed\u30b1\u30c3\u30c8\u3068\u547c\u3070\u308c\u308b=&gt; \u306b\u3088\u3063\u3066\u30ea\u30c6\u30e9\u30eb\u8868\u73fe\u3059\u308b\u307b\u3046\u304c\u7c21\u5358\u3067\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; user = { \"first_name\" =&gt; \"Michael\", \"last_name\" =&gt; \"Hartl\" }<\/strong>\r\n<strong>=&gt; {\"last_name\"=&gt;\"Hartl\", \"first_name\"=&gt;\"Michael\"}<\/strong><\/pre>\n<p>Rails\u3067\u306f\u6587\u5b57\u5217\u3088\u308a\u3082\u30b7\u30f3\u30dc\u30eb\u3092\u4f7f\u3046\u65b9\u304c\u666e\u901a\u3067\u3059\u3002<br \/>\n\u30b7\u30f3\u30dc\u30eb\u306f\u6587\u5b57\u5217\u3068\u4f3c\u3066\u3044\u307e\u3059\u304c\u3001\u30af\u30a9\u30fc\u30c8\u3067\u56f2\u3080\u4ee3\u308f\u308a\u306b\u30b3\u30ed\u30f3\u304c\u524d\u306b\u7f6e\u304b\u308c\u3066\u3044\u308b\u70b9\u304c\u7570\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070:name\u306f\u30b7\u30f3\u30dc\u30eb\u3002\u3082\u3061\u308d\u3093\u3001\u4f59\u8a08\u306a\u3053\u3068\u3092\u4e00\u5207\u8003\u3048\u305a\u306b\u3001<br \/>\n\u30b7\u30f3\u30dc\u30eb\u3092\u5358\u306a\u308b\u6587\u5b57\u5217\u3068\u307f\u306a\u3057\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<br \/>\n\u30b7\u30f3\u30dc\u30eb\u306f\u3001Ruby\u4ee5\u5916\u3067\u306f\u3054\u304f\u4e00\u90e8\u306e\u8a00\u8a9e\u306b\u3057\u304b\u63a1\u7528\u3055\u308c\u3066\u3044\u306a\u3044\u7279\u6b8a\u306a\u30c7\u30fc\u30bf\u5f62\u5f0f<\/p>\n<p>\u6700\u521d\u306f\u5947\u5999\u306b\u601d\u3046\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u304c\u3001<br \/>\nRails\u3067\u306f\u30b7\u30f3\u30dc\u30eb\u3092\u3075\u3093\u3060\u3093\u306b\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3059\u3050\u306b\u6163\u308c\u308b\u3067\u3057\u3087\u3046\u3002<br \/>\n\u305f\u3060\u3057\u6587\u5b57\u5217\u3068\u9055\u3063\u3066\u3001\u5168\u3066\u306e\u6587\u5b57\u304c\u4f7f\u3048\u308b\u308f\u3051\u3067\u306f\u306a\u3044\u3053\u3068\u306b\u6ce8\u610f\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p>\u30cf\u30c3\u30b7\u30e5\u306e\u30ad\u30fc\u3068\u3057\u3066\u30b7\u30f3\u30dc\u30eb\u3092\u63a1\u7528\u3059\u308b\u5834\u5408\u3001user \u306e\u30cf\u30c3\u30b7\u30e5\u306f\u6b21\u306e\u3088\u3046\u306b\u5b9a\u7fa9\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre><strong>user = { :name =&gt; \"Michael Hartl\", :email =&gt; \"michael@example.com\" }<\/strong>\r\n<strong>{:name=&gt;\"Michael Hartl\", :email=&gt;\"michael@example.com\"}<\/strong>\r\n<strong>user[:name] # :name \u306b\u5bfe\u5fdc\u3059\u308b\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/strong>\r\n<strong>\"Michael Hartl\"<\/strong>\r\n<strong>user[:password] # \u672a\u5b9a\u7fa9\u306e\u30ad\u30fc\u306b\u5bfe\u5fdc\u3059\u308b\u5024\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b<\/strong>\r\n<strong>nil<\/strong><\/pre>\n<p>\u672a\u5b9a\u7fa9\u306e\u30cf\u30c3\u30b7\u30e5\u5024\u306f\u5358\u7d14\u306bnil\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\n\u30b7\u30f3\u30dc\u30eb\u3068\u30cf\u30c3\u30b7\u30e5\u30ed\u30b1\u30c3\u30c8\u306e\u7d44\u307f\u5408\u308f\u305b\u3092\u3001<br \/>\n\u6b21\u306e\u3088\u3046\u306b\u30ad\u30fc\u306e\u540d\u524d\u306e(\u524d\u3067\u306f\u306a\u304f)\u5f8c\u306b\u30b3\u30ed\u30f3\u3092\u7f6e\u304d\u3001\u305d\u306e\u5f8c\u306b\u5024\u304c\u7d9a\u304f\u3088\u3046\u306b\u7f6e\u304d\u63db\u3048\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<pre><strong>{ name: \"Michael Hartl\", email: \"michael@example.com\" }<\/strong><\/pre>\n<p>JavaScript\u306a\u3069\u4ed6\u306e\u8a00\u8a9e\u306e\u30cf\u30c3\u30b7\u30e5\u8a18\u6cd5\u306b\u3088\u308a\u8fd1\u3044\u3082\u306e\u306b\u306a\u3063\u3066\u3044\u308b<\/p>\n<p>:name\u306f\u30b7\u30f3\u30dc\u30eb\u3068\u3057\u3066\u72ec\u7acb\u3057\u3066\u3044\u307e\u3059\u304c\u3001<br \/>\n\u5f15\u6570\u3092\u4f34\u308f\u306a\u3044name:\u3067\u306f\u610f\u5473\u304c\u6210\u308a\u7acb\u3061\u307e\u305b\u3093\u3002<br \/>\n\u6b21\u306e\u30b3\u30fc\u30c9\u306e:name =&gt;\u3068name:\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u3068\u3057\u3066\u306e\u30c7\u30fc\u30bf\u69cb\u9020\u306f\u5168\u304f\u540c\u3058\u3067\u3059\u3002<\/p>\n<pre><strong>{ :name =&gt; \"Michael Hartl\" }<\/strong>\r\n<strong>{ name: \"Michael Hartl\" }<\/strong><\/pre>\n<p>\u3068\u3044\u3046\u30b3\u30fc\u30c9\u306f\u7b49\u4fa1\u306b\u306a\u308a\u307e\u3059<\/p>\n<p>\u4e00\u822c\u7684\u306b\u306f\u7701\u7565\u8a18\u6cd5\u304c\u597d\u307e\u308c\u307e\u3059\u304c\u3001\u660e\u793a\u7684\u306b\u63a5\u982d\u306b\u30b3\u30ed\u30f3\u3092\u3064\u3051\u3066\u30b7\u30f3\u30dc\u30eb<br \/>\n(:name) \u3067\u3042\u308b\u3053\u3068\u3092\u5f37\u8abf\u3059\u308b\u3068\u3044\u3046\u8003\u3048\u65b9\u3082\u3042\u308a\u307e\u3059)<\/p>\n<p>\u30cf\u30c3\u30b7\u30e5\u306e\u5024\u306b\u306f\u307b\u307c\u4f55\u3067\u3082\u4f7f\u3046\u3053\u3068\u304c\u3067\u304d\u3001\u4ed6\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u4f7f\u3046\u3053\u3068\u3059\u3089\u3067\u304d\u307e\u3059\u3002<\/p>\n<h3>\u30cf\u30c3\u30b7\u30e5\u306e\u4e2d\u306e\u30cf\u30c3\u30b7\u30e5<\/h3>\n<pre><strong>params = {} #'params'\u3068\u3044\u3046\u30cf\u30c3\u30b7\u30e5\u3092\u5b9a\u7fa9\u3059\u308b('parameters'\u306e\u7565)\u3002<\/strong>\r\n<strong>params[:user] = { name: \"Michael Hartl\", email: \"mhartl@example.com\" }<\/strong>\r\n<strong>{:name=&gt;\"Michael Hartl\", :email=&gt;\"mhartl@example.com\"}<\/strong>\r\n<strong>params<\/strong>\r\n<strong>{:user=&gt;{:name=&gt;\"Michael Hartl\", :email=&gt;\"mhartl@example.com\"}}<\/strong>\r\n<strong>&gt;&gt; params[:name]<\/strong>\r\n<strong>=&gt; nil<\/strong>\r\n<strong>&gt;&gt; params[:email]<\/strong>\r\n<strong>=&gt; nil<\/strong>\r\n<strong>&gt;&gt; params[:user][:name]<\/strong>\r\n<strong>=&gt; \"Michael Hartl\"<\/strong>\r\n<strong>&gt;&gt; params[:user][:email]<\/strong>\r\n<strong>=&gt; \"mhartl@example.com\"<\/strong>\r\n<strong>&gt;&gt; params[:user]<\/strong>\r\n<strong>=&gt; {:name=&gt;\"Michael Hartl\", :email=&gt;\"mhartl@example.com\"}<\/strong><\/pre>\n<p>params = () \u3084params = []\u3067\u5165\u308c\u3088\u3046\u3068\u3059\u308b\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u30cf\u30c3\u30b7\u30e5\u306e\u30cf\u30c3\u30b7\u30e5(\u307e\u305f\u306f\u30cd\u30b9\u30c8(\u5165\u308c\u5b50))\u3055\u308c\u305f\u30cf\u30c3\u30b7\u30e5)\u304c\u5927\u91cf\u306b\u4f7f\u308f\u308c\u3066\u3044\u3066<br \/>\n\u914d\u5217\u3084\u7bc4\u56f2\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u540c\u69d8\u3001\u30cf\u30c3\u30b7\u30e5\u3082each\u30e1\u30bd\u30c3\u30c9\u306b\u5fdc\u7b54\u3057\u307e\u3059\u3002\u4f8b\u3048\u3070\u3001<br \/>\n:success\u3068:danger\u3068\u3044\u30462\u3064\u306e\u72b6\u614b\u3092\u6301\u3064 flash \u3068\u3044\u3046\u540d\u524d\u306e\u30cf\u30c3\u30b7\u30e5\u306b<br \/>\n\u3064\u3044\u3066\u8003\u3048\u3066\u307f\u3087\u3046\u3002<\/p>\n<pre><strong>&gt;&gt; flash = { success: \"It worked!\", danger: \"It failed.\" }<\/strong>\r\n<strong>=&gt; {:success=&gt;\"It worked!\", :danger=&gt;\"It failed.\"}<\/strong>\r\n<strong>&gt;&gt; flash.each do |key, value|<\/strong>\r\n<strong>?&gt; puts \"Key #{key.inspect} has value #{value.inspect}\"<\/strong>\r\n<strong>&gt;&gt; end<\/strong>\r\n<strong>Key :success has value \"It worked!\"<\/strong>\r\n<strong>Key :danger has value \"It failed.\"<\/strong><\/pre>\n<p>\u30cf\u30c3\u30b7\u30e5\u306eeach\u30e1\u30bd\u30c3\u30c9\u3067\u306f\u3001\u30d6\u30ed\u30c3\u30af\u306e\u5909\u6570\u306f\u30ad\u30fc\u3068\u5024\u306e2\u3064\u306b\u306a\u3063\u3066\u3044\u308b<\/p>\n<pre><strong>&gt;&gt; puts (1..5).to_a # \u914d\u5217\u3092\u6587\u5b57\u5217\u3068\u3057\u3066\u51fa\u529b<\/strong>\r\n<strong>1<\/strong>\r\n<strong>2<\/strong>\r\n<strong>3<\/strong>\r\n<strong>4<\/strong>\r\n<strong>5<\/strong>\r\n<strong>&gt;&gt; puts (1..5).to_a.inspect # \u914d\u5217\u306e\u30ea\u30c6\u30e9\u30eb\u3092\u51fa\u529b<\/strong>\r\n<strong>[1, 2, 3, 4, 5]<\/strong>\r\n<strong>&gt;&gt; puts :name, :name.inspect<\/strong>\r\n<strong>name<\/strong>\r\n<strong>:name<\/strong>\r\n<strong>&gt;&gt; puts \"It worked!\", \"It worked!\".inspect<\/strong>\r\n<strong>It worked!<\/strong>\r\n<strong>\"It worked!\"<\/strong><\/pre>\n<p>inspect\u3092\u4f7f\u3046\u3053\u3068\u306f\u975e\u5e38\u306b\u3088\u304f\u3042\u308b\u3053\u3068\u306a\u306e\u3067\u3001<br \/>\np\u30e1\u30bd\u30c3\u30c9\u3068\u3044\u3046\u30b7\u30e7\u30fc\u30c8\u30ab\u30c3\u30c8\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>&gt;&gt; p :name # 'puts :name.inspect' \u3068\u540c\u3058<\/strong>\r\n<strong>:name<\/strong><\/pre>\n<h3>\u6f14\u7fd2<\/h3>\n<p>1\uff1a\u30ad\u30fc\u304c&#8217;one&#8217;\u3001&#8217;two&#8217;\u3001&#8217;three&#8217;\u3068\u306a\u3063\u3066\u3044\u3066\u3001\u305d\u308c\u305e\u308c\u306e\u5024\u304c&#8217;uno&#8217;\u3001<br \/>\n&#8216;dos&#8217;\u3001&#8217;tres&#8217;\u3068\u306a\u3063\u3066\u3044\u308b\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u305d\u306e\u5f8c\u30cf\u30c3\u30b7\u30e5\u306e\u5404\u8981\u7d20\u3092\u307f\u3066\u3001<br \/>\n\u305d\u308c\u305e\u308c\u306e\u30ad\u30fc\u3068\u5024\u3092&#8221;&#8216;#{key}&#8217;\u306e\u30b9\u30da\u30a4\u30f3\u8a9e\u306f&#8217;#{value}'&#8221;<br \/>\n\u3068\u3044\u3063\u305f\u5f62\u3067\u51fa\u529b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre><strong>params = {one: 'uno',two: 'dos', three: 'tres'}<\/strong>\r\n<strong>=&gt; {:one=&gt;\"uno\", :two=&gt;\"dos\", :three=&gt;\"tres\"}<\/strong>\r\n<strong>params.each do |key, value|<\/strong>\r\n<strong>puts \"#{key.inspect} \u306e\u30b9\u30da\u30a4\u30f3\u8a9e\u306f#{value.inspect}\"<\/strong>\r\n<strong>end<\/strong>\r\n<strong>:one \u306e\u30b9\u30da\u30a4\u30f3\u8a9e\u306f\"uno\"<\/strong>\r\n<strong>:two \u306e\u30b9\u30da\u30a4\u30f3\u8a9e\u306f\"dos\"<\/strong>\r\n<strong>:three \u306e\u30b9\u30da\u30a4\u30f3\u8a9e\u306f\"tre<\/strong><\/pre>\n<p>2\uff1aperson1\u3001person2\u3001person3\u3068\u3044\u3046\uff13\u3064\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u6210\u3057\u3001\u305d\u308c\u305e\u308c\u306e<br \/>\n\u30cf\u30c3\u30b7\u30e5\u306b:first\u3068:last\u30ad\u30fc\u3092\u8ffd\u52a0\u3057\u3001\u9069\u5f53\u306a\u5024 (\u540d\u524d\u306a\u3069) \u3092\u5165\u529b\u3057\u3066\u3002<br \/>\n\u305d\u306e\u5f8c\u3001\u6b21\u306e\u3088\u3046\u306aparams\u3068\u3044\u3046\u30cf\u30c3\u30b7\u30e5\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u4f5c\u3063\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n1. \u30ad\u30fcparams[:father]\u306e\u5024\u306bperson1\u3092\u4ee3\u5165\u3001<br \/>\n2. \u30ad\u30fcparams[:mother]\u306e\u5024\u306bperson2\u3092\u4ee3\u5165\u3001<br \/>\n3. \u30ad\u30fcparams[:child]\u306e\u5024\u306bperson3\u3092\u4ee3\u5165\u3002<br \/>\n\u6700\u5f8c\u306b\u3001\u30cf\u30c3\u30b7\u30e5\u306e\u30cf\u30c3\u30b7\u30e5\u3092\u8abf\u3079\u3066\u3044\u304d\u3001<br \/>\n\u6b63\u3057\u3044\u5024\u306b\u306a\u3063\u3066\u3044\u308b\u304b\u78ba\u304b\u3081\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n(\u4f8b\u3048\u3070params[:father][:first]\u304cperson1[:first]\u3068\u4e00\u81f4\u3057\u3066\u3044\u308b\u304b\u78ba\u304b\u3081\u308b)<\/p>\n<pre><strong>&gt;&gt; person1 = {first: \"tarou\",last: \"nakamura\"}<\/strong>\r\n<strong>=&gt; {:first=&gt;\"norimiti\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; person2 = {first: \"chiko\",last: \"nakamura\"}<\/strong>\r\n<strong>=&gt; {:first=&gt;\"machiko\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; person3 = {first: \"takahiro\",last: \"nakamura\"}<\/strong>\r\n<strong>=&gt; {:first=&gt;\"hiro\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; params = {}<\/strong>\r\n<strong>=&gt; {}<\/strong>\r\n<strong>&gt;&gt; params[:father] = person1<\/strong>\r\n<strong>=&gt; {:first=&gt;\"tarou\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; params[:mother] = person2<\/strong>\r\n<strong>=&gt; {:first=&gt;\"chiko\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; params[:child] = person3<\/strong>\r\n<strong>=&gt; {:first=&gt;\"hiro\", :last=&gt;\"nakamura\"}<\/strong>\r\n<strong>&gt;&gt; params[:father][:first]<\/strong>\r\n<strong>=&gt; \"tarou\"<\/strong>\r\n<strong>&gt;&gt; person1[:first]<\/strong>\r\n<strong>=&gt; \"tarou\"<\/strong><\/pre>\n<p>3\uff1auser\u3068\u3044\u3046\u30cf\u30c3\u30b7\u30e5\u3092\u5b9a\u7fa9\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<br \/>\n\u3053\u306e\u30cf\u30c3\u30b7\u30e5\u306f\uff13\u3064\u306e\u30ad\u30fc:name\u3001:email\u3001:password_digest\u3092\u6301\u3063\u3066\u3044\u3066\u3001<br \/>\n\u305d\u308c\u305e\u308c\u306e\u5024\u306b\u3042\u306a\u305f\u306e\u540d\u524d\u3042\u306a\u305f\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3001<br \/>\n\u305d\u3057\u306616\u6587\u5b57\u304b\u3089\u306a\u308b\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u304c\u4ee3\u5165\u3055\u308c\u3066\u3044\u307e\u3059\u3002<br \/>\n\u307e\u305a16\u6587\u5b57\u306e\u30e9\u30f3\u30c0\u30e0\u306a\u6587\u5b57\u5217\u3092\u4f5c\u308b\u3088\uff01<\/p>\n<pre><strong>('a'..'z').to_a.shuffle[0..15].join<\/strong>\r\n<strong>user = {name: tuki, email: rails@example.com,<\/strong>\r\n<strong>:password_digest: ('a'..'z').to_a.shuffle[0..15].join}<\/strong><\/pre>\n<p>4\uff1aRuby API(\u3082\u3057\u304f\u306f\u308b\u308a\u307e\u30b5\u30fc\u30c1) \u3092\u4f7f\u3063\u3066\u3001Hash\u30af\u30e9\u30b9\u306emerge\u30e1\u30bd\u30c3\u30c9\u306b\u3064\u3044\u3066\u8abf\u3079\u3066\u898b\u3066\u304f\u3060\u3055\u3044<br \/>\n\u6b21\u306e\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u305b\u305a\u306b\u3001\u3069\u306e\u3088\u3046\u306a\u7d50\u679c\u304c\u8fd4\u3063\u3066\u304f\u308b\u304b\u63a8\u6e2c\u3067\u304d\u307e\u3059\u304b?<br \/>\n\u63a8\u6e2c\u3067\u304d\u305f\u3089\u3001\u5b9f\u969b\u306b\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u3066\u63a8\u6e2c\u304c\u3042\u3063\u3066\u3044\u305f\u304b\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre><strong>{ \"a\" =&gt; 100, \"b\" =&gt; 200 }.merge({ \"b\" =&gt; 300 })<\/strong>\r\n<strong>{\"a\"=&gt;100, \"b\"=&gt;300}<\/strong><\/pre>\n<h3>4.3.4 CSS\u3001\u518d\u3073<\/h3>\n<pre><strong>stylesheet_link_tag 'application', media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload'<\/strong><\/pre>\n<p>\u2191\u306e\u30b3\u30fc\u30c9\u3067\u3001\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u3092\u547c\u3093\u3067\u3044\u308b\u3002\u3053\u3053\u3067\u4e0d\u601d\u8b70\u306a\u70b9\u304c\u3044\u304f\u3064\u3082\u3042\u308b\u3002<br \/>\n\u7b2c\u4e00\u306b\u3001\u4e38\u30ab\u30c3\u30b3\u304c\u3042\u308a\u307e\u305b\u3093\u3002<br \/>\n\u5b9f\u306f\u3001Ruby \u3067\u306f\u4e38\u30ab\u30c3\u30b3\u306f\u4f7f\u7528\u3057\u3066\u3082\u3057\u306a\u304f\u3066\u3082\u69cb\u3044\u307e\u305b\u3093\u3002<br \/>\n\u6b21\u306e2\u3064\u306e\u884c\u306f\u7b49\u4fa1<\/p>\n<p># \u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306e\u4e38\u30ab\u30c3\u30b3\u306f\u7701\u7565\u53ef\u80fd\u3002<\/p>\n<pre><strong>stylesheet_link_tag('application', media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload')<\/strong>\r\n<strong>stylesheet_link_tag 'application', media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload'<\/strong><\/pre>\n<p>media\u5f15\u6570\u306f\u30cf\u30c3\u30b7\u30e5\u306e\u3088\u3046\u3067\u3059\u304c\u3001\u6ce2\u30ab\u30c3\u30b3\u304c\u306a\u3044\u70b9\u304c\u4e0d\u601d\u8b70\u3067\u3059\u3002<br \/>\n\u5b9f\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u304c\u30e1\u30bd\u30c3\u30c9\u547c\u3073\u51fa\u3057\u306e\u6700\u5f8c\u306e\u5f15\u6570\u3067\u3042\u308b\u5834\u5408\u306f\u3001<br \/>\n\u6ce2\u30ab\u30c3\u30b3\u3092\u7701\u7565\u3067\u304d\u307e\u3059\u3002\u6b21\u306e2\u3064\u306e\u884c\u306f\u7b49\u4fa1\u3067\u3059\u3002<\/p>\n<p># \u6700\u5f8c\u306e\u5f15\u6570\u304c\u30cf\u30c3\u30b7\u30e5\u306e\u5834\u5408\u3001\u6ce2\u30ab\u30c3\u30b3\u306f\u7701\u7565\u53ef\u80fd\u3002<\/p>\n<pre><strong>stylesheet_link_tag 'application', { media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload' }<\/strong>\r\n<strong>stylesheet_link_tag 'application', media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload'<\/strong><\/pre>\n<p>\u6700\u5f8c\u306b\u3001Ruby\u304c\u6b21\u306e\u3088\u3046\u306a\u30b3\u30fc\u30c9\u3092\u6b63\u5e38\u306b\u5b9f\u884c\u3067\u304d\u3066\u3044\u308b\u306e\u304c\u4e0d\u601d\u8b70\u3067\u3059\u3002<br \/>\nRuby\u306f\u6539\u884c\u3068\u7a7a\u767d\u3092\u533a\u5225\u3057\u3066\u3044\u306a\u3044\u3001\u884c\u3092\u5206\u5272\u3057\u305f\u7406\u7531\u306f\u3001<br \/>\n\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3092\u8aad\u307f\u3084\u3059\u304f\u3059\u308b\u305f\u3081<\/p>\n<pre><strong>stylesheet_link_tag 'application', media: 'all',<\/strong>\r\n<strong>'data-turbolinks-track': 'reload'<\/strong><\/pre>\n<p>stylesheet_link_tag\u30e1\u30bd\u30c3\u30c9\u30922\u3064\u306e\u5f15\u6570\u3067\u547c\u3093\u3067\u3044\u308b\u3002<br \/>\n\u6700\u521d\u306e\u5f15\u6570\u3067\u3042\u308b\u6587\u5b57\u5217\u306f\u3001\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u3078\u306e\u30d1\u30b9\u3092\u793a\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u6b21\u306e\u5f15\u6570\u3067\u3042\u308b\u30cf\u30c3\u30b7\u30e5\u306b\u306f2\u3064\u306e\u8981\u7d20\u304c\u3042\u308a\u3001<br \/>\n\u6700\u521d\u306e\u8981\u7d20\u306f\u30e1\u30c7\u30a3\u30a2\u30bf\u30a4\u30d7(\u5168\u3066)\u3092\u793a\u3057\u3001<br \/>\n\u6b21\u306e\u8981\u7d20\u306fRails 4.0\u3067\u8ffd\u52a0\u3055\u308c\u305fturbolinks\u3068\u3044\u3046\u6a5f\u80fd\u3092\u30aa\u30f3\u306b\u3057\u3066\u3044\u307e\u3059\u3002<br \/>\n\u3053\u306e\u7d50\u679c\u3001&lt;%= %&gt; \u3067\u56f2\u307e\u308c\u3066\u3044\u308b\u30b3\u30fc\u30c9\u3092\u5b9f\u884c\u3057\u305f\u7d50\u679c\u304c<br \/>\nERb\u306e\u30c6\u30f3\u30d7\u30ec\u30fc\u30c8\u306b\u633f\u5165\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u3001<br \/>\n\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u3053\u306e\u30da\u30fc\u30b8\u306e\u30bd\u30fc\u30b9\u3092\u8868\u793a\u3059\u308b\u3068\u3001<br \/>\n\u5fc5\u8981\u306a\u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8\u304c\u542b\u307e\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<br \/>\n(CSS\u30d5\u30a1\u30a4\u30eb\u540d\u306e\u5f8c\u306b\u3001?body=1\u306e\u3088\u3046\u306a\u884c\u304c\u4f59\u5206\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\u3002<br \/>\n\u3053\u308c\u3089\u306fRails\u306b\u3088\u3063\u3066\u633f\u5165\u3055\u308c\u3066\u3044\u308b\u3082\u306e\u3067\u3001\u30b5\u30fc\u30d0\u30fc\u4e0a\u3067\u5909\u66f4\u304c\u3042\u3063\u305f\u5834\u5408\u306b\u30d6\u30e9\u30a6\u30b6\u304cCSS\u3092\u518d\u8aad\u307f\u8fbc\u307f\u3059\u308b\u306e\u306b\u4f7f\u3063\u3066\u3044\u308b\u3002)<\/p>\n<p>\u3061\u306a\u307f\u306b\u8aad\u307f\u8fbc\u307e\u308c\u305fCSS\u306b\u3088\u3063\u3066\u751f\u6210\u3055\u308c\u305fHTML\u30bd\u30fc\u30b9\u3002<\/p>\n<pre><strong>&lt;link data-turbolinks-track=\"true\"<\/strong>\r\n<strong>href=\"\/assets\/application.css\"media=\"all\" rel=\"stylesheet\" \/&gt;<\/strong><\/pre>\n<p><a href=\"https:\/\/suzutukiblog.com\/index.php\/2021\/04\/24\/rails-tutorial4-8\/\">4.8\u306b\u7d9a\u304f<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u305d\u306e4\u304b\u3089\u7d9a\u304d\u307e\u3059 4.3.1 \u914d\u5217\u3068\u7bc4\u56f2\u6f14\u7b97\u5b50 \u914d\u5217\u3092\u7406\u89e3\u3059\u308b\u3053\u3068\u306f\u3001\u30cf\u30c3\u30b7\u30e5\u3084Rails\u306e\u30c7\u30fc\u30bf\u30e2\u30c7\u30eb\u3092\u7406\u89e3\u3059\u308b\u305f\u3081\u306e\u91cd\u8981\u306a\u57fa\u76e4 split\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u3046\u3068\u3001\u6587\u5b57\u5217\u3092\u81ea\u7136\u306b\u5909\u63db\u3057\u305f\u914d\u5217\u3092\u5f97\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002 &gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2764,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[27,13],"tags":[],"class_list":["post-2973","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-programming-note","category-rails"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=2973"}],"version-history":[{"count":14,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2973\/revisions"}],"predecessor-version":[{"id":4526,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/posts\/2973\/revisions\/4526"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media\/2764"}],"wp:attachment":[{"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=2973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=2973"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/suzutukiblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=2973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}