<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>a1026302</author_name>
  <author_url>https://blog.hatena.ne.jp/a1026302/</author_url>
  <blog_title>ものづくりのブログ</blog_title>
  <blog_url>https://a1026302.hatenablog.com/</blog_url>
  <categories>
    <anon>Crystal</anon>
    <anon>Crystal-構文</anon>
  </categories>
  <description>Ruby ライクなプログラミング言語 crystal について勉強してます。今回は型の判定方法についてです。 crystal で is_a? というメソッドを使うと、型の判定が行えます。 実際に使うと以下のような感じです。ユニオン型の変数で確認してみます。 icr(0.33.0) &gt; if 1 + 2 == 3 icr(0.33.0) &gt; a = 1 icr(0.33.0) &gt; else icr(0.33.0) &gt; a = nil icr(0.33.0) &gt; end =&gt; 1 icr(0.33.0) &gt; typeof(a) =&gt; (Int32 | Nil) icr(0.33.0) &gt; a =&gt;…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa1026302.hatenablog.com%2Fentry%2F2021%2F12%2F12%2F085639&quot; title=&quot; Crystal - 型の判定方法 【is_a?】 - ものづくりのブログ&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>2021-12-12 08:56:39</published>
  <title> Crystal - 型の判定方法 【is_a?】</title>
  <type>rich</type>
  <url>https://a1026302.hatenablog.com/entry/2021/12/12/085639</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
