<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>kwatch</author_name>
  <author_url>https://blog.hatena.ne.jp/kwatch/</author_url>
  <blog_title>kなんとかの日記</blog_title>
  <blog_url>https://kwatch.hatenadiary.org/</blog_url>
  <categories>
    <anon>ruby</anon>
  </categories>
  <description>class ERB def result_hash(hash) b = binding hash.each {|k,v| eval &quot;#{k} = %Q[#{v}]&quot;, b} result b end end puts ERB.new('&lt;%= example %&gt;').result_hash(:example =&gt; 'foo') ERB で引数の hash を展開して欲しい - #生存戦略 、それは - subtech これだと、値がArrayとかだったらうまくいかない。また繰り返しごとにevalするのは効率が悪い。こう書き換えたほうがいいだろう。 class ERB def result_…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fkwatch.hatenadiary.org%2Fentry%2F20080609%2F1213029122&quot; title=&quot; ERB で Binding のかわりに Hash を使う - kなんとかの日記&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2008-06-09 01:32:02</published>
  <title> ERB で Binding のかわりに Hash を使う</title>
  <type>rich</type>
  <url>https://kwatch.hatenadiary.org/entry/20080609/1213029122</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
