種類
- インスタンスメソッド (44)
- 文書 (33)
- 特異メソッド (11)
ライブラリ
- ビルトイン (11)
-
irb
/ cmd / subirb (11) -
irb
/ context (11) -
irb
/ inspector (11) -
json
/ add / exception (11)
クラス
- Exception (11)
-
IRB
:: Context (11) -
IRB
:: ExtendCommand :: IrbCommand (11) -
IRB
:: Inspector (11) - Object (11)
キーワード
- Ruby用語集 (11)
-
def
_ inspector (11) - execute (11)
-
respond
_ to? (11) -
ruby 1
. 6 feature (11) -
to
_ json (11) - 正規表現 (11)
検索結果
先頭5件
-
IRB
:: Context # main -> object (24301.0) -
self に設定されたオブジェクトを返します。
self に設定されたオブジェクトを返します。
@see cwws コマンド -
Exception
# to _ json(*args) -> String (9206.0) -
自身を JSON 形式の文字列に変換して返します。
...自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡......れます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivisionError\",\"m\":\"divided by 0\",\"b\":[\"/path/to/test.rb:4:in `/'\",\"/path/to/test.rb:4:in `<main>'\"]}"
end
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
IRB
:: ExtendCommand :: IrbCommand # execute(*obj) -> IRB :: Irb (6306.0) -
新しいサブ irb インタプリタを起動します。
...新しいサブ irb インタプリタを起動します。
@param obj 新しいサブ irb インタプリタで self にするオブジェクトを指定
します。省略した場合は irb を起動したときの main オブジェク
トを self にします。... -
IRB
:: Inspector . def _ inspector(key , arg = nil) { |v| . . . } -> object (6206.0) -
新しい実行結果の出力方式を定義します。
...@param key conf.inspect_mode や IRB.conf[:INSPECT_MODE] に指定するキー
オブジェクトを指定します。配列を指定した場合は配列中の要素全
てが対象になります。
@param arg ブロックを指定する場合には、inspect_mode の初......quire が必要な場合
などに、proc { require "foo" } といった指定を行います。
ブロックを指定しない場合には、実行結果の出力のための手続きオ
ブジェクトを指定します。
例.
# .irbrc
IRB::Inspector.def_ins......pector([:test]){ |v| v.to_s * 2 }
$ irb --inspect test
irb(main):001:0> :abc # => abcabc
@see lib:irb#inspect_mode... -
Object
# respond _ to?(name , include _ all = false) -> bool (3106.0) -
オブジェクトがメソッド name を持つとき真を返します。
...クトが メソッド name に応答できることをいいます。
Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組......otImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。
@param include_all priva......onjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello)}
#=> Bonjour
list.each{|it| it.instance_eval("puts hello if it.respond_to?(:hello, true)")}
#=> Bonjour
# Guten Tag
module Template
def main... -
ruby 1
. 6 feature (1140.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ruby 1.6 feature
ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン
になります。
((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。
== 1.6.8 (2002-12-24) ->......EAGAIN と EWOULDBLOCK が同じ値のシステムで、EWOULDBLOCK がなくなっ
ていました。現在は、このようなシステムでは、EWOULDBLOCK は、EAGAIN
として定義されています。(これは 1.6.7 とは異なる挙動です)
p Errno::EAGAIN......-ja:PR#122>))
p(-1[-1])
=> ruby 1.6.5 (2001-09-19) [i586-linux]
1
=> ruby 1.6.5 (2001-11-01) [i586-linux]
1
: Numeric#remainder
((<ruby-bugs-ja:PR#110>))
p( 3.remainder(-3))
p(-3.remainder(3))
=> ruby 1.6.5 (2001-09-19) [i... -
正規表現 (102.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
...achar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は文字列......eal/.match("surrealist") # => nil
# 単語境界がrealの前にないのでマッチしない
/\breal/.match("surrealist") # => nil
//}
単語を成す文字、成さない文字の定義はエンコードによって
異なります。以下の例で「全角」括弧は EUC-JP では
単語を......ING を
指定することで明示的に指定することが可能です。
//emlist[][ruby]{
# -*- coding:utf-8 -*-
/あいう/.fixed_encoding? # => true
/abc/.fixed_encoding? # => false
/abc/e.fixed_encoding? # => true
/abc/ =~ "あいう" # => nil
/abc/e =~ "あいう"
# ~> -:6:in `<main>': i... -
Ruby用語集 (86.0)
-
Ruby用語集 A B C D E F G I J M N O R S Y
...Ruby用語集
A B C D E F G I J M N O R S Y
a ka sa ta na ha ma ya ra wa
=== 記号・数字
: %記法
: % notation
「%」記号で始まる多種多様なリテラル記法の総称。
参照:d:spec/literal#percent
: 0 オリジン
: zero-ba......sed
番号が 0 から始まること。
例えば、
Array や Vector、Matrix などの要素の番号、
String における文字の位置、
といったものは 0 オリジンである。
: 1 オリジン
: one-based
番号が 1 から始まること。
例えば、
エラ......: mix-in
=ミックスイン
: MRI: Matz’ Ruby Implementation
=CRuby
: mruby
組込み向けの Ruby 仕様および処理系。省メモリー性など、機器組み込みや
アプリケーションソフト組込みに適した特徴を持つ。
https://mruby.org/
: main...