種類
- インスタンスメソッド (1471)
- 特異メソッド (93)
- モジュール関数 (33)
- クラス (22)
- 変数 (11)
クラス
- Array (173)
- BasicObject (55)
- Bignum (9)
- Class (22)
- Complex (5)
-
Encoding
:: Converter (22) -
Enumerator
:: Lazy (33) -
Enumerator
:: Yielder (11) - Exception (22)
-
File
:: Stat (11) - Fixnum (15)
- Float (22)
- Hash (90)
- IO (11)
- Integer (77)
- Method (32)
- Module (126)
- Numeric (66)
- Object (121)
- Proc (11)
- Range (96)
- Rational (11)
-
RubyVM
:: InstructionSequence (141) - String (135)
- Symbol (11)
- Thread (38)
-
Thread
:: Backtrace :: Location (11) -
Thread
:: SizedQueue (27) - Time (11)
- TracePoint (6)
- UnboundMethod (11)
モジュール
- Enumerable (132)
- Kernel (44)
キーワード
- ! (11)
- != (11)
-
$ < (11) - % (11)
- << (59)
- <= (25)
- <=> (132)
- == (11)
- === (11)
- BasicObject (11)
- Numeric (11)
- [] (11)
-
absolute
_ path (11) -
backtrace
_ locations (33) -
base
_ label (22) - bind (11)
-
bit
_ length (17) - bsearch (44)
-
bsearch
_ index (18) -
chunk
_ while (11) -
class
_ variables (11) - compile (11)
-
compile
_ file (11) - concat (19)
-
const
_ source _ location (5) -
delete
_ if (22) - disasm (22)
- disassemble (22)
- div (11)
- divmod (22)
- downto (22)
-
drop
_ while (55) - enq (9)
-
enum
_ for (22) - filter (12)
- include (11)
- include? (11)
- inherited (11)
- initialize (11)
-
insert
_ output (11) - inspect (11)
-
instance
_ eval (22) -
instance
_ methods (11) -
instance
_ of? (11) -
instruction
_ sequence (6) -
is
_ a? (11) -
kind
_ of? (11) - label (11)
- max (60)
-
method
_ defined? (11) - methods (11)
- min (118)
- minmax (10)
- modulo (11)
- new (11)
- of (11)
- pack (19)
- path (11)
- print (11)
-
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11) - push (9)
- reject (22)
- reject! (22)
- remainder (11)
- replacement= (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) - scrub (33)
- scrub! (33)
- select (12)
-
set
_ backtrace (11) -
slice
_ when (11) - split (17)
-
super
_ method (10) - superclass (11)
-
take
_ while (66) - test (22)
-
to
_ binary (9) -
to
_ enum (22) -
to
_ s (11) - unpack (11)
- yield (11)
検索結果
先頭5件
-
Integer
# <(other) -> bool (29114.0) -
比較演算子。数値として小さいか判定します。
...比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。
//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}... -
Fixnum
# <(other) -> bool (29102.0) -
比較演算子。数値として小さいか判定します。
比較演算子。数値として小さいか判定します。
@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。 -
Module
# <(other) -> bool | nil (26238.0) -
比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。
...較では
nil を返します。
@param other 比較対象のモジュールやクラス
@raise TypeError other がクラスやモジュールではない場合に発生します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo #......=> true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil
p Foo < Object.new # => in `<': compared with non class/module (TypeError)
//}... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (17408.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# i......rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (17214.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...script_compiledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval......("puts 'hello'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
Encoding
:: Converter # insert _ output(string) -> nil (17208.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
...tring 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.primitive_convert(src, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is ", "."]
ec.insert_output("<e......r>")
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}]" #=> ["HIRAGANA LETTER A is <err>.", ""]
ec = Encoding::Converter.new("utf-8", "iso-2022-jp")
src = "\u{306F 3041 3068 2661 3002}" # U+2661 is not representable in iso-2022-jp
dst = ""
p ec.primitive_convert(s......rc, dst) #=> :undefined_conversion
puts "[#{dst.dump}, #{src.dump}]" #=> ["\e$B$O$!$H".force_encoding("ISO-2022-JP"), "\xE3\ x80\x82"]
ec.insert_output "?" # state change required to output "?".
p ec.primitive_convert(src, dst) #=> :finished
puts "[#{dst.dump}, #{src.dump}... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (17208.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...ception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_month(month)
return if D......aise "#{month} is not long month"
end
def get_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:i......n `<main>'"]
//}
@see Exception#backtrace... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (17208.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...れたiseqのデータを文字列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.......load_from_binary_extra_data メソッドでこの文字列にアクセス出来ます。
注意: 変換後のバイナリデータはポータブルではありません。 to_binary で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキ......テクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_binary("extra_data")
# ※表示の都合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x00\x00... -
Bignum
# <<(bits) -> Fixnum | Bignum (17202.0) -
シフト演算子。bits だけビットを左にシフトします。
...シフト演算子。bits だけビットを左にシフトします。
@param bits シフトさせるビット数
printf("%#b\n", 0b0101 << 1) #=> 0b1010
p -1 << 1 #=> -2... -
Bignum
# <=>(other) -> Fixnum | nil (17202.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1... -
File
:: Stat # <=>(o) -> Integer | nil (17202.0) -
ファイルの最終更新時刻を比較します。self が other よりも 新しければ正の数を、等しければ 0 を古ければ負の数を返します。 比較できない場合は nil を返します。
...nil を返します。
@param o File::Stat のインスタンスを指定します。
//emlist[][ruby]{
require 'tempfile' # for Tempfile
fp1 = Tempfile.open("first")
fp1.print "古い方\n"
sleep(1)
fp2 = Tempfile.open("second")
fp2.print "新しい方\n"
p File::Stat.new(fp1.path) <=> File::S......tat.new(fp2.path) #=> -1
p File::Stat.new(fp2.path) <=> File::Stat.new(fp1.path) #=> 1
p File::Stat.new(fp1.path) <=> fp2.path #=> nil
//}... -
Fixnum
# <<(bits) -> Fixnum | Bignum (17202.0) -
シフト演算子。bits だけビットを左にシフトします。
...シフト演算子。bits だけビットを左にシフトします。
@param bits シフトさせるビット数
printf("%#b\n", 0b0101 << 1) #=> 0b1010
p -1 << 1 #=> -2... -
Fixnum
# <=>(other) -> Fixnum (17202.0) -
self と other を比較して、self が大きい時に正、 等しい時に 0、小さい時に負の整数を返します。
...self と other を比較して、self が大きい時に正、
等しい時に 0、小さい時に負の整数を返します。
@param other 比較対象の数値
@return -1 か 0 か 1 のいずれか
1 <=> 2 #=> -1
1 <=> 1 #=> 0
2 <=> 1 #=> 1... -
Integer
# <<(bits) -> Integer (17202.0) -
シフト演算子。bits だけビットを左にシフトします。
...シフト演算子。bits だけビットを左にシフトします。
@param bits シフトさせるビット数
//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//}...