<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>ema_hiro</author_name>
  <author_url>https://blog.hatena.ne.jp/ema_hiro/</author_url>
  <blog_title>emahiro/b.log</blog_title>
  <blog_url>https://ema-hiro.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
  </categories>
  <description>ユースケース オブジェクトの中に意図するプロパティを取り出せるのかを確かめる方法に、オブジェクトが持つメソッドを調査するという方法があります。 rubyではjsonオブジェクトのプロパティもメソッドとして取り出せるので、プロパティ not found エラーが発生してプログラムの処理が中断してしまわないか予め調べておくことができたら便利です。 Obj.methods.grep(regexp) を使用する。 例えばある特定のAPIを叩いて返ってきたレスポンスオブジェウトのプロパティを調べるという動作を想定します。 response.methods.grep(/任意のメソッド名 or プロパティ名…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fema-hiro.hatenablog.com%2Fentry%2F20170519%2F1495127591&quot; title=&quot;rubyでオブジェクトの持つメソッドを探索する - emahiro/b.log&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>2017-05-19 02:13:11</published>
  <title>rubyでオブジェクトの持つメソッドを探索する</title>
  <type>rich</type>
  <url>https://ema-hiro.hatenablog.com/entry/20170519/1495127591</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
