Interactive_Rubyとは? わかりやすく解説

Weblio 辞書 > 辞書・百科事典 > 百科事典 > Interactive_Rubyの意味・解説 

Interactive Ruby

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2025/02/08 23:47 UTC 版)

Interactive Ruby
開発元 石塚圭樹
最新版
1.15.1 / 2025年1月22日 (17日前) (2025-01-22)[1]
リポジトリ
プログラミング
言語
Ruby
対応OS クロスプラットフォーム
種別 シェル
ライセンス 2条項BSDライセンス
公式サイト github.com/ruby/irb
テンプレートを表示

Interactive Ruby (IRB、irb) は、Rubyを対話的に実行 (REPL) するためのシェルである。

irbコマンドを実行することでコマンドプロンプトが表示され、Rubyの式を入力することでそれが実行され、結果が表示される。 Readlineがインストールされている場合、コマンドライン編集や履歴などの機能を利用できる。

Ruby 2.7に添付されているirbでは、Readlineに代わってRelineが採用された[2]

irbは石塚圭樹によって開発された。

構文と実行例

構文:

irb [options] file_name opts

実行例:

irb(main):001:0> n = 5
=> 5
irb(main):002:0> def fact(n)
irb(main):003:1>   if n <= 1
irb(main):004:2>     1
irb(main):005:2>   else
irb(main):006:2*     n * fact(n - 1)
irb(main):007:2>   end
irb(main):008:1> end
=> :fact
irb(main):009:0> fact(n)
=> 120

irb(main):001:0> class Cat
irb(main):002:1>   def meow
irb(main):003:2>     puts 'The cat meows.'
irb(main):004:2>   end
irb(main):005:1> end
=> :meow

irb(main):006:0> Cat.new.meow
The cat meows.

脚注

  1. ^ All versions of irb”. RubyGems.org. 2025年2月9日閲覧。
  2. ^ naruse (2019年12月25日). “Ruby 2.7.0 リリース”. ruby-lang.org. 2020年7月6日閲覧。

関連項目

外部リンク


「Interactive Ruby」の例文・使い方・用例・文例

Weblio日本語例文用例辞書はプログラムで機械的に例文を生成しているため、不適切な項目が含まれていることもあります。ご了承くださいませ。


英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「Interactive_Ruby」の関連用語

Interactive_Rubyのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



Interactive_Rubyのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアのInteractive Ruby (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。
Tanaka Corpusのコンテンツは、特に明示されている場合を除いて、次のライセンスに従います:
 Creative Commons Attribution (CC-BY) 2.0 France.
この対訳データはCreative Commons Attribution 3.0 Unportedでライセンスされています。
浜島書店 Catch a Wave
Copyright © 1995-2025 Hamajima Shoten, Publishers. All rights reserved.
株式会社ベネッセコーポレーション株式会社ベネッセコーポレーション
Copyright © Benesse Holdings, Inc. All rights reserved.
研究社研究社
Copyright (c) 1995-2025 Kenkyusha Co., Ltd. All rights reserved.
日本語WordNet日本語WordNet
日本語ワードネット1.1版 (C) 情報通信研究機構, 2009-2010 License All rights reserved.
WordNet 3.0 Copyright 2006 by Princeton University. All rights reserved. License
日外アソシエーツ株式会社日外アソシエーツ株式会社
Copyright (C) 1994- Nichigai Associates, Inc., All rights reserved.
「斎藤和英大辞典」斎藤秀三郎著、日外アソシエーツ辞書編集部編
EDRDGEDRDG
This page uses the JMdict dictionary files. These files are the property of the Electronic Dictionary Research and Development Group, and are used in conformance with the Group's licence.

©2025 GRAS Group, Inc.RSS