{"id":283105,"date":"2016-12-27T12:00:11","date_gmt":"2016-12-27T09:00:11","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=283105"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=283105","title":{"rendered":"\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 send \u0434\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u043e\u0442 \u0431\u0435\u0437\u044b\u0441\u0445\u043e\u0434\u043d\u043e\u0441\u0442\u0438 \u0438 \u0440\u0430\u0434\u0438 \u0440\u0430\u0437\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u044f"},"content":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c89\/9b2\/547\/c899b254775440adbb76027708707360.png\"\/><br \/>  <a href=\"https:\/\/github.com\/mperham\/sidekiq\/blob\/b63a8571524e1e505c93c97c2bdb1c352f845064\/lib\/sidekiq.rb#L51\">\u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Sidekiq. <a href=\"http:\/\/stackoverflow.com\/questions\/23975346\/why-is-%E2%95%AF%C2%B0%E2%96%A1%C2%B0-%E2%95%AF-%E2%94%BB%E2%94%81%E2%94%BB-with-such-an-encoding-used-for-a-method-name\">\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0439\u043b\u0430<\/a><\/p>\n<p>  <\/p>\n<p><em>send<\/em> \u0432 Ruby \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e \u0438\u043c\u0435\u043d\u0438. \u0412\u043e\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\"># \u0414\u043e: \u044f\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435. \u041d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0435\u0439 \u043c\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043e\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435. user.name = &quot;\u0418\u0432\u0430\u043d&quot; user.age = 29  # \u041f\u043e\u0441\u043b\u0435: \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c. \u0420\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430. def set(field, value)   send(&quot;#{field}=&quot;, value) end user.set(:name, &quot;\u0418\u0432\u0430\u043d&quot;) user.set(:age, 29)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0435\u0449\u0451 \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u0438\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\">after_create :send_email<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430-\u0434\u0430, \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0438 \u0432 \u0440\u0435\u043b\u044c\u0441\u0430\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b <a href=\"https:\/\/github.com\/rails\/rails\/blob\/38fe5ae24476ef8808d5eb6366afe84ff43a3279\/activesupport\/lib\/active_support\/callbacks.rb#L432\">\u0442\u043e\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e send<\/a>.<\/p>\n<p>  <\/p>\n<p><a name=\"habracut\"><\/a><\/p>\n<p>  <\/p>\n<p><strong>\u0415\u0449\u0451 \u0447\u0435\u0440\u0435\u0437 send \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u044e\u0442 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b<\/strong>. \u041e \u0442\u043e\u043c, \u043d\u0443\u0436\u043d\u043e \u043b\u0438 \u0432\u043e\u043e\u0431\u0449\u0435 \u0438\u0445 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c, <a href=\"https:\/\/vimeo.com\/48106365\">\u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442<\/a> Sandi Metz, \u0430\u0432\u0442\u043e\u0440 \u043a\u043d\u0438\u0433\u0438 <a href=\"http:\/\/www.poodr.com\/\">Practical Object-Oriented Design in Ruby<\/a> (\u043e \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u0430\u0445 \u0441 10:58).<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u0440\u0430\u0442\u043a\u0438\u0439 \u043f\u0435\u0440\u0435\u0432\u043e\u0434-\u043f\u0435\u0440\u0435\u0441\u043a\u0430\u0437<\/b><\/p>\n<div class=\"spoiler_text\">\n<p>\u041e\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0438\u0437\u043b\u0438\u0448\u043d\u0438\u043c: \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0442 100%-\u0435 \u043f\u043e\u043a\u0440\u044b\u0442\u0438\u0435. \u041d\u043e \u043f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0440\u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043d\u0435\u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 Sandi \u043d\u0430\u0440\u0443\u0448\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u043a\u043e\u043f\u0430\u0442\u044c\u0441\u044f \u0432 \u0442\u0440\u0435\u0439\u0441\u0430\u0445, \u0430 \u043b\u043e\u0432\u0438\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0443 \u0432 \u043c\u0435\u0441\u0442\u0435 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u043e\u0432\u0435\u043d\u0438\u044f. \u0422\u0430\u043a\u0438\u0435 \u0442\u0435\u0441\u0442\u044b \u043e\u043d\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u043c\u0438 \u0438 \u0441 \u0433\u043e\u0442\u043e\u0432\u043d\u043e\u0441\u0442\u044c\u044e \u0443\u0434\u0430\u043b\u044f\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043a\u043e\u0434 \u0441\u0442\u0430\u0431\u0438\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u041e\u043d\u0430 \u0432 \u043a\u0443\u0440\u0441\u0435 \u043f\u0440\u043e \u043f\u043e\u0434\u0445\u043e\u0434 &quot;\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432\u044b\u043d\u0435\u0441\u0438\u0442\u0435 \u0435\u0433\u043e \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441&quot;, \u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0442 \u0442\u0430\u043a\u043e\u0433\u043e \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u0434 \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u044b\u043c.<\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<p><strong>\u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u0435\u0437 send \u043d\u0435 \u043e\u0431\u043e\u0439\u0442\u0438\u0441\u044c:<\/strong><\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\">data_point = OpenStruct.new(:queued? =&gt; true) data_point.queued?  # -&gt; true data_point.send(&quot;queued?=&quot;,false) # \u0438\u043d\u0430\u0447\u0435 \u0442\u0430\u043a\u043e\u0439 \u043c\u0435\u0442\u043e\u0434 \u043d\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c data_point.queued?  # -&gt; false<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e OpenStruct. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0434\u0443\u043c\u0430\u043d\u043d\u044b\u0439, \u043d\u043e \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0438 \u0431\u043e\u043b\u0435\u0435 \u0441\u0442\u0440\u0430\u043d\u043d\u044b\u0435: \u0432\u0437\u044f\u0442\u044c \u0445\u043e\u0442\u044c \u0442\u043e\u0442 \u0436\u0435 \u043c\u0435\u0442\u043e\u0434 \u0438\u0437 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u043e\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<p><strong>\u0412 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0435\u043d\u0438\u0435 \u0442\u0435\u043c\u044b \u043e \u043d\u0435\u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/strong>. \u0427\u0430\u0441\u0442\u043e \u043f\u044b\u0442\u0430\u0435\u0442\u0435\u0441\u044c \u0432\u044b\u0439\u0442\u0438 \u0438\u0437 irb \u043a\u043e\u043c\u0430\u043d\u0434\u043e\u0439 <em>\u0443\u0447\u0448\u0435<\/em>? \u041f\u0440\u043e\u0441\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0432 <code>~\/.irbrc<\/code> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\">module Kernel   def \u0443\u0447\u0448\u0435     exit   end end<\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432 \u0433\u043e\u043b\u043e\u0432\u0443, \u043f\u043e\u043a\u0430 \u043e\u0431\u0434\u0443\u043c\u044b\u0432\u0430\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u043b\u044f \u0441\u0442\u0430\u0442\u044c\u0438; \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0440\u0430\u0434\u0438 \u0442\u0435\u0441\u0442\u0430 \u0441\u0435\u0431\u0435 \u0432 .irbrc \u2014 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442. \u0421\u043e\u0431\u0438\u0440\u0430\u043b\u0441\u044f \u0431\u044b\u043b\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c, \u043f\u043e\u0442\u043e\u043c \u0434\u0443\u043c\u0430\u044e: &quot;\u0410 \u0432\u0435\u0434\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0436\u0435&quot;. \u041f\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u0432\u0438\u043b, \u043f\u0443\u0441\u043a\u0430\u0439 \u043f\u043e\u043b\u0435\u0436\u0438\u0442 \u043d\u0435\u0434\u0435\u043b\u044c\u043a\u0443.<\/p>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u044f \u043e\u0442\u0447\u0430\u044f\u043d\u043d\u044b\u0445: \u0437\u0430\u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0435 \u0443\u0447\u0448\u0435-exit?<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"ruby\">module Kernel   def method_missing(method_name, *arguments, &amp;block)     return(super) unless contains_russian_letters?(method_name.to_s)     possible_meaning = translit(method_name.to_s)     send(possible_meaning, *arguments)   end    private    def translit(string)     string.chars.map do |char|       russian_to_english_mapping[char] || char     end.join   end    def contains_russian_letters?(string)     !(string.chars &amp; russian_symbols).empty?   end    def russian_symbols     &quot;\u0439\u0446\u0443\u043a\u0435\u043d\u0433\u0448\u0449\u0437\u0445\u044a\u0444\u044b\u0432\u0430\u043f\u0440\u043e\u043b\u0434\u0436\u044d\u044f\u0447\u0441\u043c\u0438\u0442\u044c\u0431\u044e&quot;.chars   end    def russian_to_english_mapping     english = &quot;qwertyuiop[]asdfghjkl;'zxcvbnm,.&quot;.chars     russian_symbols.zip(english).to_h   end end  # \u041f\u0440\u043e\u0431\u0443\u0435\u043c: puts(1.inspect) # \u0412\u044b\u0432\u043e\u0434\u0438\u0442 1 \u0437\u0433\u0435\u044b(1.\u0448\u0442\u044b\u0437\u0443\u0441\u0435) # \u0422\u043e\u0436\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442. \u0420\u0430\u0431\u043e\u0442\u0430\u0435\u0442!<\/code><\/pre>\n<p>  <\/p>\n<p>\u041e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c <em>\u044d\u0442\u043e<\/em> \u043d\u0435 \u0440\u0435\u0448\u0438\u043b\u0441\u044f. <\/p>\n<\/div>\n<\/div>\n<p>  <\/p>\n<h3 id=\"nedostatki\">\u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438<\/h3>\n<p>  <\/p>\n<p>\u041d\u0435\u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 <em>send<\/em> \u0443\u0445\u0443\u0434\u0448\u0430\u0435\u0442 \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\"># \u0412\u0430\u0440\u0438\u0430\u043d\u0442 1. \u0427\u0438\u0442\u0430\u0435\u043c\u043e, \u043d\u043e \u043d\u0435 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e if params[:sort_by] == &quot;age&quot;   users.sort_by_age else   users.sort_by_name end  # \u0412\u0430\u0440\u0438\u0430\u043d\u0442 2. \u041c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e, \u043d\u043e \u043d\u0435\u0447\u0438\u0442\u0430\u0435\u043c\u043e sorting_method = &quot;sort_by_#{params[:sort_by]}&quot; users.send(sorting_method)  # \u041b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434 \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043f\u0438\u0441\u0430\u0442\u044c  # \u0438 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u043e, \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u043e: users.sort_by(params[:sort_by])<\/code><\/pre>\n<p>  <\/p>\n<h3 id=\"podvedyom-itogi\">\u041f\u043e\u0434\u0432\u0435\u0434\u0451\u043c \u0438\u0442\u043e\u0433\u0438<\/h3>\n<p>  <\/p>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 <code>send<\/code>, \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e:<\/p>\n<p>  <\/p>\n<ul>\n<li>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f;<\/li>\n<li>\u041f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0438 \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434\u043d\u044b\u0435 \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0438;<\/li>\n<li>\u0412\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0432 \u0442\u0435\u0441\u0442\u0430\u0445.<\/li>\n<\/ul>\n<p>  <\/p>\n<p>\u041d\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 send \u0431\u0435\u0437 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438.<\/p>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/318546\/\"> https:\/\/habrahabr.ru\/post\/318546\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/c89\/9b2\/547\/c899b254775440adbb76027708707360.png\"\/><br \/>  <a href=\"https:\/\/github.com\/mperham\/sidekiq\/blob\/b63a8571524e1e505c93c97c2bdb1c352f845064\/lib\/sidekiq.rb#L51\">\u041e\u0434\u0438\u043d \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u043e\u0432<\/a> \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 Sidekiq. <a href=\"http:\/\/stackoverflow.com\/questions\/23975346\/why-is-%E2%95%AF%C2%B0%E2%96%A1%C2%B0-%E2%95%AF-%E2%94%BB%E2%94%81%E2%94%BB-with-such-an-encoding-used-for-a-method-name\">\u041e\u0431\u044a\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u0441\u043c\u0430\u0439\u043b\u0430<\/a><\/p>\n<p>  <\/p>\n<p><em>send<\/em> \u0432 Ruby \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u043c\u0435\u0442\u043e\u0434\u044b \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043f\u043e \u0438\u043c\u0435\u043d\u0438. \u0412\u043e\u0442 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\"># \u0414\u043e: \u044f\u0432\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u043d\u0438\u0435. \u041d\u0435\u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0435\u0439 \u043c\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043e\u043d\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f \u0432 \u0440\u0430\u043d\u0442\u0430\u0439\u043c\u0435. user.name = &quot;\u0418\u0432\u0430\u043d&quot; user.age = 29  # \u041f\u043e\u0441\u043b\u0435: \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u0438\u043c\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c. \u0420\u0435\u0448\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430. def set(field, value)   send(&quot;#{field}=&quot;, value) end user.set(:name, &quot;\u0418\u0432\u0430\u043d&quot;) user.set(:age, 29)<\/code><\/pre>\n<p>  <\/p>\n<p>\u0410 \u0435\u0449\u0451 \u0432\u044b \u043d\u0430\u0432\u0435\u0440\u043d\u044f\u043a\u0430 \u0432\u0438\u0434\u0435\u043b\u0438 \u0442\u0430\u043a\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<p>  <\/p>\n<pre><code class=\"ruby\">after_create :send_email<\/code><\/pre>\n<p>  <\/p>\n<p>\u0414\u0430-\u0434\u0430, \u043a\u043e\u043b\u043b\u0431\u044d\u043a\u0438 \u0432 \u0440\u0435\u043b\u044c\u0441\u0430\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b <a href=\"https:\/\/github.com\/rails\/rails\/blob\/38fe5ae24476ef8808d5eb6366afe84ff43a3279\/activesupport\/lib\/active_support\/callbacks.rb#L432\">\u0442\u043e\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e send<\/a>.<\/p>\n<p>  <\/p>\n<p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-283105","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=283105"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/283105\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=283105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=283105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=283105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}