{"id":997,"date":"2012-12-10T13:06:27","date_gmt":"2012-12-10T04:06:27","guid":{"rendered":"http:\/\/www.techscore.com\/blog\/?p=997"},"modified":"2018-11-14T16:33:58","modified_gmt":"2018-11-14T07:33:58","slug":"%e5%85%a5%e5%8a%9b%e5%80%a4%e3%81%ae%e8%87%aa%e5%8b%95%e5%a4%89%e6%8f%9b","status":"publish","type":"post","link":"https:\/\/www.techscore.com\/blog\/2012\/12\/10\/%e5%85%a5%e5%8a%9b%e5%80%a4%e3%81%ae%e8%87%aa%e5%8b%95%e5%a4%89%e6%8f%9b\/","title":{"rendered":"\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db"},"content":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db\u3092\u984c\u6750\u306b\u3001\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db\u3068\u306f\u3001\u4f8b\u3048\u3070\u4f1a\u54e1\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u3067\u5165\u529b\u3055\u308c\u305f\u5185\u5bb9\u3092 DB \u306b\u4fdd\u5b58\u3059\u308b\u524d\uff08\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u524d\uff09\u306b\u81ea\u52d5\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u5168\u3066\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3059\u308b\u3001\u540d\u524d\u306f\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3059\u308b\u3001\u90f5\u4fbf\u756a\u53f7\u304c\u5168\u89d2\u3067\u5165\u529b\u3055\u308c\u308b\u304b\u3082\u3057\u308c\u306a\u3044\u306e\u3067\u534a\u89d2\u306b\u5909\u63db\u3059\u308b\u3001\u3068\u3044\u3063\u305f\u3082\u306e\u3067\u3059\u3002<\/p>\n<h2>\u30e6\u30fc\u30b6\u306e\u540d\u524d\u306e\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u81ea\u52d5\u7684\u306b\u524a\u9664\u3059\u308b<\/h2>\n<p>\u307e\u305a\u306f\u30e6\u30fc\u30b6\u306e\u540d\u524d\uff08User#name\uff09\u304c\u5165\u529b\u3055\u308c\u305f\u6642\u306b\u3001\u5148\u982d\u3068\u672b\u5c3e\u306b\u3042\u308b\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3057\u3088\u3046\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u540d\u524d\u306e\u524d\u5f8c\u306b\u30b9\u30da\u30fc\u30b9\u304c\u5165\u529b\u3055\u308c\u308b\u3053\u3068\u306a\u3093\u3066\u3042\u308b\u304b\u3044\u306a\u3002\u3042\u308b\u3093\u3067\u3059\u3002<\/p>\n<p>\u30e6\u30fc\u30b6\u306b\u3088\u308b\u5165\u529b\u306b\u306f\u4e88\u60f3\u5916\u306b\u63fa\u3089\u304e\u304c\u3042\u308b\u3053\u3068\u304c\u591a\u3044\u3067\u3059\u3002\u3069\u3053\u304b\u5225\u306e\u5834\u6240\u304b\u3089\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3059\u308b\u3068\u304d\u306b\u4e0d\u8981\u306a\u534a\u89d2\u30b9\u30da\u30fc\u30b9\u304c\u542b\u307e\u308c\u3066\u3057\u307e\u3046\u3053\u3068\u3082\u3042\u308a\u307e\u3059\u3002\u6570\u5b57\u3092\u5165\u529b\u3059\u308b\u9805\u76ee\u3060\u304b\u3089\u3068\u3044\u3063\u3066\u534a\u89d2\u6570\u5b57\u3067\u5165\u529b\u3055\u308c\u308b\u3068\u306f\u9650\u308a\u307e\u305b\u3093\u3002\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306f\u5168\u3066\u5c0f\u6587\u5b57\u3067\u5165\u529b\u3055\u308c\u308b\u3053\u3068\u3082\u3042\u308c\u3070\u3001\u5927\u6587\u5b57\u3067\u5165\u529b\u3055\u308c\u308b\u3053\u3068\u3082\u3001\u306f\u305f\u307e\u305f\u5927\u6587\u5b57\u3068\u5c0f\u6587\u5b57\u304c\u6df7\u5728\u3057\u3066\u5165\u529b\u3055\u308c\u308b\u304b\u3082\u3057\u308c\u307e\u305b\u3093\u3002\u958b\u767a\u8005\u304c\u60f3\u5b9a\u3057\u305f\u5f62\u5f0f\u3067\u5165\u529b\u3055\u308c\u308b\u3068\u671f\u5f85\u3057\u3059\u304e\u3066\u306f\u3044\u3051\u307e\u305b\u3093\u3002<\/p>\n<p>\u8a71\u304c\u305d\u308c\u307e\u3057\u305f\u304c\u3001\u5165\u529b\u3055\u308c\u305f\u30e6\u30fc\u30b6\u540d\u306e\u5148\u982d\u3068\u672b\u5c3e\u306b\u4e0d\u8981\u306a\u30b9\u30da\u30fc\u30b9\u304c\u3042\u308b\u5834\u5408\u306f\u81ea\u52d5\u7684\u306b\u524a\u9664\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3092\u5b9f\u73fe\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b name=(value) \u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308c\u3070\u9054\u6210\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">class User &lt; ActiveRecord::Base\r\n\r\n  def name=(value)\r\n    value = value.strip if value.kind_of?(String)\r\n    write_attribute(:name, value)\r\n  end\r\n\r\nend<\/pre>\n<p>\u307e\u3060\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f\u3057\u3066\u3044\u307e\u305b\u3093\u3002<\/p>\n<p>\u5165\u529b\u3055\u308c\u305f\u5024\u304c String \u3067\u3042\u308c\u3070 String#strip \u3067\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3057\u3066\u3001\u305d\u306e\u5024\u3092 write_attribute \u3067\u8a2d\u5b9a\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001\u540d\u524d\u4ee5\u5916\u306e\u5c5e\u6027\u3001\u4f8b\u3048\u3070\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u306b\u3064\u3044\u3066\u3082\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u81ea\u52d5\u7684\u306b\u524a\u9664\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u5834\u5408\u306f\u3069\u3046\u3057\u307e\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u5148\u307b\u3069\u5b9a\u7fa9\u3057\u305f name=(value) \u30e1\u30bd\u30c3\u30c9\u3092\u30b3\u30d4\u30fc\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b email=(value) \u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304f\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u304c\u3001\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3057\u3066\u3044\u308b\u6642\u70b9\u3067\u5acc\u306a\u611f\u3058\u304c\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">  def email=(value)\r\n    value = value.strip if value.kind_of?(String)\r\n    write_attribute(:email, value)\r\n  end<\/pre>\n<h2>\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 - \u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b<\/h2>\n<p>\u305d\u3053\u3067\u767b\u5834\u3059\u308b\u306e\u304c\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3067\u3059\u3002<\/p>\n<p>\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3067\u985e\u4f3c\u3057\u305f\u30e1\u30bd\u30c3\u30c9\u3092\u5927\u91cf\u751f\u7523\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u524a\u9664\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<p>\u540d\u524d\u306f attr_trimming_writer \u3068\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  def self.attr_trimming_writer(name)\r\n    # name=(value) \u306f Rails \u306b\u3088\u3063\u3066\u52d5\u7684\u306b\u5b9a\u7fa9\u3055\u308c\u308b\u306e\u3067, \u3053\u3053\u3067\u4e00\u5ea6\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059.\r\n    self.new.send(\"#{name}=\", nil)\r\n\r\n    define_method(\"#{name}_with_trimming=\") do |value|\r\n      value = value.strip if value.kind_of?(String)\r\n      send(\"#{name}_without_trimming=\", value)\r\n    end\r\n    alias_method_chain \"#{name}=\", :trimming\r\n  end<\/pre>\n<p>\u305d\u3057\u3066\u3001\u5b9a\u7fa9\u3057\u305f attr_trimming_writer \u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  attr_trimming_writer :name\r\n  attr_trimming_writer :email<\/pre>\n<p>\u3053\u308c\u3067\u30b3\u30d4\u30fc\uff06\u30da\u30fc\u30b9\u30c8\u3067\u985e\u4f3c\u30e1\u30bd\u30c3\u30c9\u3092\u3044\u304f\u3064\u3082\u4f5c\u308b\u306e\u3067\u306f\u306a\u304f\u3001attr_trimming_writer \u3068\u3044\u3046\u4e00\u3064\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u307e\u3068\u3081\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u88dc\u8db3\u3067\u3059\u304c\u3001\u4e0a\u8a18\u30b3\u30fc\u30c9\u3067\u306f writer_attribute \u3067\u5909\u63db\u5f8c\u306e\u5024\u3092\u76f4\u63a5\u8a2d\u5b9a\u3059\u308b\u306e\u3067\u306f\u306a\u304f\u3001send(\"#{name}_without_trimming=\", value) \u306e\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<p>\u3053\u308c\u306f\u4eca\u5f8c\u306e\u5e03\u77f3\u3068\u3057\u3066\u3001\u3053\u306e\u3088\u3046\u306b\u5b9f\u88c5\u3057\u3066\u3044\u307e\u3059\u3002<\/p>\n<h2>\u30b9\u30da\u30fc\u30b9\u306e\u524a\u9664\u4ee5\u5916\u306b\u3082\u8272\u3005\u81ea\u52d5\u5909\u63db\u3057\u305f\u3044<\/h2>\n<p>\u3053\u3053\u307e\u3067\u306f\u5165\u529b\u5024\u306e\u5148\u982d\u3068\u672b\u5c3e\u306e\u30b9\u30da\u30fc\u30b9\u3092\u81ea\u52d5\u7684\u306b\u524a\u9664\u3059\u308b\u3001\u3068\u3044\u3046\u51e6\u7406\u3092\u884c\u306a\u3063\u3066\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u3057\u304b\u3057\u3001\u30b9\u30da\u30fc\u30b9\u306e\u524a\u9664\u4ee5\u5916\u306b\u3082\u5024\u306e\u81ea\u52d5\u5909\u63db\u3092\u884c\u306a\u3044\u305f\u3044\u5834\u5408\u3082\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u3001\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u3067\u3042\u308c\u3070\u5165\u529b\u5024\u3092\u5168\u3066\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3057\u305f\u3044\u3001\u90f5\u4fbf\u756a\u53f7\u3067\u3042\u308c\u3070\u5168\u89d2\u6570\u5024\u3092\u534a\u89d2\u6570\u5024\u306b\u5909\u63db\u3057\u305f\u3044\u3001\u3068\u3044\u3046\u5177\u5408\u3067\u3059\u3002<\/p>\n<p>\u305d\u308c\u3067\u306f\u3001attr_trimming_writer \u3068\u540c\u69d8\u306b\u3001\u5c0f\u6587\u5b57\u306b\u5909\u63db\u3059\u308b attr_downcase_writer\u3001\u5168\u89d2\u6570\u5024\u3092\u534a\u89d2\u6570\u5024\u306b\u5909\u63db\u3059\u308b attr_number_writer \u3092\u5b9a\u7fa9\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">class User &lt; ActiveRecord::Base\r\n\r\n  def self.attr_downcase_writer(name)\r\n    # name=(value) \u306f Rails \u306b\u3088\u3063\u3066\u52d5\u7684\u306b\u5b9a\u7fa9\u3055\u308c\u308b\u306e\u3067, \u3053\u3053\u3067\u4e00\u5ea6\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059.\r\n    self.new.send(\"#{name}=\", nil)\r\n\r\n    define_method(\"#{name}_with_downcase=\") do |value|\r\n      value = value.downcase if value.kind_of?(String)\r\n      send(\"#{name}_without_downcase=\", value)\r\n    end\r\n    alias_method_chain \"#{name}=\", :downcase\r\n  end\r\n\r\n  def self.attr_number_writer(name)\r\n    # name=(value) \u306f Rails \u306b\u3088\u3063\u3066\u52d5\u7684\u306b\u5b9a\u7fa9\u3055\u308c\u308b\u306e\u3067, \u3053\u3053\u3067\u4e00\u5ea6\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059.\r\n    self.new.send(\"#{name}=\", nil)\r\n\r\n    define_method(\"#{name}_with_number=\") do |value|\r\n      value = value.tr('\uff10-\uff19', '0-9') if value.kind_of?(String)\r\n      send(\"#{name}_without_number=\", value)\r\n    end\r\n    alias_method_chain \"#{name}=\", :number\r\n  end\r\n\r\nend<\/pre>\n<p>attr_trimming_writer \u3068\u5024\u306e\u5909\u63db\u90e8\u5206\u4ee5\u5916\u306f\u540c\u3058\u306a\u306e\u3067\u5206\u304b\u308a\u3084\u3059\u3044\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u5148\u307b\u3069\u3001\u300csend(\"#{name}_without_trimming=\", value) \u3068\u3057\u3066\u3044\u308b\u306e\u306f\u4eca\u5f8c\u306e\u5e03\u77f3\u3067\u3042\u308b\u300d\u3068\u8a00\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3053\u308c\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b attr_xxx_writer \u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u7528\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u305f\u3081\u3067\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  attr_trimming_writer :email\r\n  attr_downcase_writer :email<\/pre>\n<h2>\u3082\u3063\u3068\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0 - \u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u5b9a\u7fa9\u3059\u308b<\/h2>\n<p>attr_trimming_writer\u3001attr_downcase_writer\u3001attr_number_writer \u3068\u5b9a\u7fa9\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u305d\u308c\u3089\u306e\u30e1\u30bd\u30c3\u30c9\u306f\u5024\u306e\u5909\u63db\u90e8\u5206\u4ee5\u5916\u306f\u5168\u3066\u540c\u3058\u3067\u3059\u3002<\/p>\n<p>\u3068\u3044\u3046\u3053\u3068\u306f\u3001attr_xxx_writer \u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3001\u3068\u3044\u3046\u3082\u306e\u3092\u4f5c\u308b\u3053\u3068\u304c\u3067\u304d\u305d\u3046\u3067\u3059\u3002<\/p>\n<p>\u5b9f\u969b\u306b attr_xxx_writer \u3092\u5b9a\u7fa9\u3059\u308b\u30e1\u30bd\u30c3\u30c9\u3092\u66f8\u304f\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  def self.define_custom_attr_writer(conversion_name, conversion_proc)\r\n    self.singleton_class.send(:define_method, \"attr_#{conversion_name}_writer\") do |name|\r\n      # name=(value) \u306f Rails \u306b\u3088\u3063\u3066\u52d5\u7684\u306b\u5b9a\u7fa9\u3055\u308c\u308b\u306e\u3067, \u3053\u3053\u3067\u4e00\u5ea6\u30a2\u30af\u30bb\u30b9\u3057\u307e\u3059.\r\n      self.new.send(\"#{name}=\", nil)\r\n\r\n      define_method(\"#{name}_with_#{conversion_name}=\") do |value|\r\n        value = conversion_proc.call(value) if value.kind_of?(String)\r\n        send(\"#{name}_without_#{conversion_name}=\", value)\r\n      end\r\n      alias_method_chain \"#{name}=\", conversion_name\r\n    end\r\n  end<\/pre>\n<p>\u305d\u3057\u3066\u3001define_custom_attr_writer \u3092\u4f7f\u7528\u3057\u3066\u3001attr_trimming_writer\u3001attr_downcase_writer\u3001attr_number_writer \u3092\u5b9a\u7fa9\u3057\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  define_custom_attr_writer :trimming, lambda{|value| value.strip}\r\n  define_custom_attr_writer :downcase, lambda{|value| value.downcase}\r\n  define_custom_attr_writer :number, lambda{|value| value.tr('\uff10-\uff19', '0-9')}<\/pre>\n<p>\u305d\u3057\u3066\u3001attr_xxx_writer \u3092\u4f7f\u3046\u90e8\u5206\u306e\u30b3\u30fc\u30c9\u306f\u4ee5\u524d\u3068\u540c\u3058\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre class=\"lang:ruby decode:true\">  attr_trimming_writer :name\r\n  attr_trimming_writer :email\r\n  attr_downcase_writer :email<\/pre>\n<h2>\u307e\u3068\u3081<\/h2>\n<p>\u4eca\u56de\u306f\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db\u3092\u984c\u6750\u306b\u3001\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u3092\u6d3b\u7528\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066\u304a\u8a71\u3057\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u30b3\u30fc\u30c9\u306f\u3001\u3069\u3061\u3089\u304b\u3068\u3044\u3046\u3068\u300c\u3071\u3063\u3068\u898b\u305f\u3060\u3051\u3067\u306f\u5206\u304b\u308a\u3065\u3089\u3044\u300d\u50be\u5411\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306f DRY (Don't Repeat Yourself) \u306a\u30b3\u30fc\u30c9\u306b\u3059\u308b\u305f\u3081\u306b\u591a\u5927\u306a\u52b9\u679c\u3092\u767a\u63ee\u3057\u307e\u3059\u304c\u3001\u30c7\u30e1\u30ea\u30c3\u30c8\u3082\u610f\u8b58\u3057\u305f\u4e0a\u3067\u6d3b\u7528\u3057\u305f\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>\u30c9\u30ad\u30e5\u30e1\u30f3\u30c6\u30fc\u30b7\u30e7\u30f3\u3092\u3057\u3063\u304b\u308a\u3059\u308b\u3053\u3068\u3084\u3001\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u7279\u6709\u306e\u5206\u304b\u308a\u3065\u3089\u3055\u3092\u307e\u304d\u6563\u3089\u3055\u306a\u3044\u3053\u3068\uff08\u305d\u308c\u3092\u4f7f\u3046\u30b3\u30fc\u30c9\u306b\u5bfe\u3057\u3066\u30d6\u30e9\u30c3\u30af\u30dc\u30c3\u30af\u30b9\u3067\u3042\u308b\u3053\u3068\uff09\u304c\u91cd\u8981\u3060\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4e00\u65b9\u3067\u3001\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306b\u3088\u3063\u3066\u300c\u30b3\u30f3\u30d1\u30af\u30c8\u306a\u30b3\u30fc\u30c9\u304c\u66f8\u3051\u305f\uff01\u300d\u300c\u5de5\u6570\u304c\u5927\u5e45\u306b\u524a\u6e1b\u3067\u304d\u305f\uff01\u300d\u3068\u3044\u3046\u6642\u306e\u559c\u3073\u306f\u7d76\u5927\u3067\u3059\u3002<\/p>\n<p>\u7528\u6cd5\u7528\u91cf\u3092\u5b88\u3063\u3066\u3001\u7bc0\u5ea6\u306e\u3042\u308b\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u30e9\u30a4\u30d5\u3092\u9001\u308a\u305f\u3044\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>Enjoy Metaprogramming!!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3093\u306b\u3061\u306f\u3001\u9234\u6728\u3067\u3059\u3002<\/p>\n<p>\u4eca\u56de\u306f\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db\u3092\u984c\u6750\u306b\u3001\u30e1\u30bf\u30d7\u30ed\u30b0\u30e9\u30df\u30f3\u30b0\u306e\u8a71\u3092\u3057\u307e\u3059\u3002<\/p>\n<p>\u5165\u529b\u5024\u306e\u81ea\u52d5\u5909\u63db\u3068\u306f\u3001\u4f8b\u3048\u3070\u4f1a\u54e1\u767b\u9332\u30d5\u30a9\u30fc\u30e0\u3067\u5165\u529b\u3055\u308c\u305f\u5185\u5bb9\u3092 DB \u306b\u4fdd\u5b58\u3059\u308b\u524d\uff08\u30d0\u30ea\u30c7\u30fc\u30b7\u30e7\u30f3\u3059\u308b\u524d\uff09\u306b\u81ea\u52d5\u5909\u63db\u3059\u308b\u3053\u3068\u3067\u3059\u3002<br \/><a href=\"https:\/\/www.techscore.com\/blog\/2012\/12\/10\/%e5%85%a5%e5%8a%9b%e5%80%a4%e3%81%ae%e8%87%aa%e5%8b%95%e5%a4%89%e6%8f%9b\/\">\u7d9a\u304d\u3092\u8aad\u3080...<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[18],"tags":[22,24,61],"_links":{"self":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/997"}],"collection":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/comments?post=997"}],"version-history":[{"count":1,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/997\/revisions"}],"predecessor-version":[{"id":18006,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/posts\/997\/revisions\/18006"}],"wp:attachment":[{"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/media?parent=997"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/categories?post=997"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.techscore.com\/blog\/wp-json\/wp\/v2\/tags?post=997"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}