<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>apo-co</author_name>
  <author_url>https://blog.hatena.ne.jp/apo-co/</author_url>
  <blog_title>L’Isle joyeuse</blog_title>
  <blog_url>https://apo-co.hatenadiary.org/</blog_url>
  <categories>
    <anon>ruby</anon>
    <anon>rails</anon>
  </categories>
  <description>open_sessionで特異メソッドを定義したら、変数の持ち主に注意しましょうというお話。 次のように定義したとします。 def user open_session do |u| def u.access_to_home get '/home/index' end end end まず、これはエラーなく実行できます。 get '/home/index' assert_response :success ところが、これはエラーしてしまいます。 @user = user @user.access_to_home assert_response :success #=&gt; NoMethodError…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fapo-co.hatenadiary.org%2Fentry%2F20110822%2Fp1&quot; title=&quot;open_sessionで特異メソッドを定義するときの注意 - L’Isle joyeuse&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>2011-08-22 00:00:00</published>
  <title>open_sessionで特異メソッドを定義するときの注意</title>
  <type>rich</type>
  <url>https://apo-co.hatenadiary.org/entry/20110822/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
