種類
- インスタンスメソッド (1006)
- 特異メソッド (270)
- モジュール関数 (148)
- クラス (20)
クラス
- Array (27)
- BasicObject (11)
- Data (2)
- Dir (11)
-
Encoding
:: Converter (66) - Enumerator (38)
-
Enumerator
:: Lazy (11) - Exception (22)
- Fiber (27)
-
File
:: Stat (110) - Hash (66)
- IO (254)
- Method (21)
- Module (71)
- Mutex (2)
- NameError (17)
- NoMethodError (17)
- Object (55)
- Range (11)
- Regexp (44)
-
RubyVM
:: InstructionSequence (33) - Struct (26)
- Thread (139)
-
Thread
:: Mutex (9) -
Thread
:: Queue (27) -
Thread
:: SizedQueue (36) - Time (16)
- TracePoint (30)
モジュール
- Enumerable (66)
- Kernel (148)
オブジェクト
- ENV (11)
キーワード
- ! (11)
- < (11)
- <=> (33)
- Complex (12)
- ConditionVariable (9)
- Float (6)
- Integer (11)
- Rational (11)
- Stat (11)
- [] (22)
- backtrace (11)
-
backtrace
_ locations (22) - binding (2)
- blksize (11)
- blocks (11)
-
callee
_ id (11) - close (20)
- closed? (11)
- compile (22)
-
compile
_ option= (11) -
deconstruct
_ keys (2) - default (22)
-
default
_ proc (11) - deq (9)
-
dev
_ major (11) -
dev
_ minor (11) - dig (9)
- display (11)
- each (63)
-
each
_ line (66) -
eval
_ script (6) - exception (11)
- fail (33)
- feed (11)
- fetch (7)
- ftype (11)
- getbyte (11)
- getc (11)
- gets (33)
-
insert
_ output (11) - inspect (11)
-
instance
_ variable _ get (11) -
instance
_ variables (11) - join (22)
-
keyword
_ init? (3) -
last
_ error (11) - length (9)
- loop (9)
- match (22)
- max (22)
-
method
_ id (11) - min (44)
- name (11)
- pack (16)
- pass (11)
- path (2)
-
pending
_ interrupt? (11) - pop (9)
-
primitive
_ convert (44) - private (16)
- produce (5)
- raise (38)
-
rdev
_ major (11) -
rdev
_ minor (11) - readline (33)
- resume (11)
-
set
_ trace _ func (11) - shift (29)
-
singleton
_ class (11) - size (20)
- size? (11)
- sleep (11)
-
source
_ location (11) - status (11)
- stop (11)
- store (11)
-
super
_ method (10) -
thread
_ variable _ get (11) -
to
_ path (2) -
to
_ s (11) -
trace
_ var (33) - ungetbyte (11)
- ungetc (11)
- yield (11)
検索結果
先頭5件
- File
:: Stat . new(path) -> File :: Stat - Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , in: nil) -> Time - Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , zone = nil) -> Time - Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , in: nil) -> Time - Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , zone = nil) -> Time
-
File
:: Stat . new(path) -> File :: Stat (24321.0) -
path に関する File::Stat オブジェクトを生成して返します。 File.stat と同じです。
...File::Stat オブジェクトを生成して返します。
File.stat と同じです。
@param path ファイルのパスを指定します。
@raise Errno::ENOENT pathに該当するファイルが存在しない場合発生します。
//emlist[][ruby]{
p $:[0]
#=> 例
# "C:/Program Files/rub......y-1.8/lib/ruby/site_ruby/1.8"
p File::Stat.new($:[0])
#=> 例
#<File::Stat dev=0x2, ino=0, mode=040755, nlink=1, uid=0, gid=0, rdev=0x2, size=0, blksize=nil, blocks=nil, atime=Sun Sep 02 14:15:20 +0900 2007, mtime=Tue Apr 24 23:03:44 +0900 2007, ctime=Tue Apr 24 23:03:37 +0900 2007>
//}... -
Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , in: nil) -> Time (22840.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
mon day hour min sec に nil を指定した場合の値は、その引数がとり得る最小の値です。
zone と in に nil を指定した場合の値は、現在のタイムゾーンに従います。
@param year......から 31 までの整数か文字列で指定します。
@param hour 時を 0 から 23 までの整数か文字列で指定します。
@param min 分を 0 から 59 までの整数か文字列で指定します。
@param sec 秒を 0 から 60 までの整数か文字列で指定します。......の文字列で指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が... -
Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , zone = nil) -> Time (22840.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
mon day hour min sec に nil を指定した場合の値は、その引数がとり得る最小の値です。
zone と in に nil を指定した場合の値は、現在のタイムゾーンに従います。
@param year......から 31 までの整数か文字列で指定します。
@param hour 時を 0 から 23 までの整数か文字列で指定します。
@param min 分を 0 から 59 までの整数か文字列で指定します。
@param sec 秒を 0 から 60 までの整数か文字列で指定します。......の文字列で指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が... -
Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , in: nil) -> Time (22835.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
mon day hour min sec に nil を指定した場合の値は、その引数がとり得る最小の値です。
zone と in に nil を指定した場合の値は、現在のタイムゾーンに従います。
@param year......から 31 までの整数か文字列で指定します。
@param hour 時を 0 から 23 までの整数か文字列で指定します。
@param min 分を 0 から 59 までの整数か文字列で指定します。
@param sec 秒を 0 から 60 までの整数か文字列で指定します。......の文字列で指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が... -
Time
. new(year , mon = nil , day = nil , hour = nil , min = nil , sec = nil , zone = nil) -> Time (22835.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
mon day hour min sec に nil を指定した場合の値は、その引数がとり得る最小の値です。
zone に nil を指定した場合の値は、現在のタイムゾーンに従います。
@param year 年を......から 31 までの整数か文字列で指定します。
@param hour 時を 0 から 23 までの整数か文字列で指定します。
@param min 分を 0 から 59 までの整数か文字列で指定します。
@param sec 秒を 0 から 60 までの整数か文字列で指定します。......を、秒を単位とする整数か、
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が無効である場合に発生します。
//emlist[][ruby]{
p Time.new(2008, 6, 21, 13, 30, 0, "+09:00") # => 2008-06-21 13:30:00 +0900
//}......タイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が無効である場合に発生します。
//emlist[][ruby]{
p Time.new(2008, 6, 21, 13, 30, 0, "+09:00") # => 2008-06-21 13:30:00 +0900
//}......引数で指定した地方時の Time オブジェクトを返します。
mon day hour min sec に nil を指定した場合の値は、その引数がとり得る最小の値です。
zone と in に nil を指定した場合の値は、現在のタイムゾーンに従います。
@param year......の文字列で指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータイムゾーンの文字列または
"+HH:MM" "-HH:MM" 形式の文字列で指定します。
@raise ArgumentError 与えられた引数が... -
RubyVM
:: InstructionSequence . new(source , file = nil , path = nil , line = 1 , options = nil) -> RubyVM :: InstructionSequence (21909.0) -
引数 source で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param source Ruby のソースコードを文字列で指定します。
@param file ファイル名を文字列で指定します。
@param path 引数 file の絶対パスファイル名を......。
@param line 引数 source の 1 行目の行番号を指定します。
@param options コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参......照
してください。
RubyVM::InstructionSequence.compile("a = 1 + 2")
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
@see RubyVM::InstructionSequence.compile_file... -
Regexp
. new(string , option = nil , code = nil) -> Regexp (21513.0) -
文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
...文字列 string をコンパイルして正規表現オブジェクトを生成して返します。
第一引数が正規表現であれば第一引数を複製して返します。第二、第三引数は警告の上無視されます。
@param string 正規表現を文字列として与えま......@param option Regexp::IGNORECASE, Regexp::MULTILINE,
Regexp::EXTENDED
の論理和を指定します。
Integer 以外であれば真偽値の指定として見なされ
、真(nil, false 以外)であれば
Regexp::IGNORECASE......ングは ASCII-8BIT になります。
それ以外の指定は警告を出力します。
@raise RegexpError 正規表現のコンパイルに失敗した場合発生します。
//emlist[例][ruby]{
str = "This is Regexp"
t1 = Regexp.compile("this is regexp", Regexp::IGNORECASE)
t1... -
Enumerator
:: Lazy . new(obj , size=nil) {|yielder , *values| . . . } -> Enumerator :: Lazy (21440.0) -
Lazy Enumerator を作成します。Enumerator::Lazy#force メソッドなどに よって列挙が実行されたとき、objのeachメソッドが実行され、値が一つずつ ブロックに渡されます。ブロックは、yielder を使って最終的に yield される値を 指定できます。
...
Lazy Enumerator を作成します。Enumerator::Lazy#force メソッドなどに
よって列挙が実行されたとき、objのeachメソッドが実行され、値が一つずつ
ブロックに渡されます。ブロックは、yielder を使って最終的に yield される値を
指定で....../emlist[Enumerable#filter_map と、その遅延評価版を定義する例][ruby]{
module Enumerable
def filter_map(&block)
map(&block).compact
end
end
class Enumerator::Lazy
def filter_map
Lazy.new(self) do |yielder, *values|
result = yield *values
yielder << result if r......esult
end
end
end
1.step.lazy.filter_map{|i| i*i if i.even?}.first(5)
# => [4, 16, 36, 64, 100]
//}
@raise ArgumentError 引数を指定しなかった場合、ブロックを指定しなかった場合に発生します。
@see Enumerator.new... -
Time
. new(iso8601 , in: nil) -> Time (21440.0) -
引数で指定した地方時の Time オブジェクトを返します。
...引数で指定した地方時の Time オブジェクトを返します。
@param iso8601 Time#inspectの結果や制限されたISO-8601形式などの文字列を指定します。
@param in 協定世界時との時差を、秒を単位とする整数か、
"UTC" かミリタリータ......
iso8601 に指定された文字列がタイムゾーンを持っている場合は無視されます。
@raise ArgumentError iso8601が無効な形式の場合に発生します。
//emlist[][ruby]{
p Time.new("2024-02-15 10:20:30") # => 2024-02-15 10:20:30 +0900
p Tim......e.new("2024-02-15 10:20:30 UTC", in: "+0800") # => 2024-02-15 10:20:30 UTC
p Time.new("2024-02-15 10:20:30", in: "+0800") # => 2024-02-15 10:20:30 +0800
//}... -
Exception
. new(error _ message = nil) -> Exception (21411.0) -
例外オブジェクトを生成して返します。
...属性 Exception#message の値になり、デフォルトの例外ハンドラで表示されます。
//emlist[例][ruby]{
e = Exception.new("some message")
p e # => #<Exception: some message>
p e.message # => "some message"
//}
//emlist[例][ruby]{
e = Exception.exception("some messag......e")
p e # => #<Exception: some message>
p e.message # => "some message"
//}... -
NoMethodError
. new(error _ message = "" , name = nil , args = nil , priv = false) -> NoMethodError (18714.0) -
例外オブジェクトを生成して返します。
...数です
@param priv private なメソッドを呼び出せる形式 (関数形式(レシーバを省略した形式)) で呼ばれたかどうかを指定します
@param receiver 原因となったメソッド呼び出しのレシーバです
例:
nom = NoMethodError.new("message", "foo", [1... -
NoMethodError
. new(error _ message = "" , name = nil , args = nil , priv = false , receiver:) -> NoMethodError (18714.0) -
例外オブジェクトを生成して返します。
...数です
@param priv private なメソッドを呼び出せる形式 (関数形式(レシーバを省略した形式)) で呼ばれたかどうかを指定します
@param receiver 原因となったメソッド呼び出しのレシーバです
例:
nom = NoMethodError.new("message", "foo", [1... -
NoMethodError
. new(error _ message = "" , name = nil , args = nil , priv = false) -> NoMethodError (18711.0) -
例外オブジェクトを生成して返します。
...ソッド呼び出しに使われた引数です
@param priv private なメソッドを呼び出せる形式 (関数形式(レシーバを省略した形式)) で呼ばれたかどうかを指定します
例:
nom = NoMethodError.new("message", "foo", [1,2,3])
p nom.name
p nom.args
# =... -
NoMethodError
. new(error _ message = "" , name = nil , args = nil) -> NoMethodError (18611.0) -
例外オブジェクトを生成して返します。
...param error_message エラーメッセージを表す文字列です
@param name 未定義だったシンボルです
@param args メソッド呼び出しに使われた引数です
例:
nom = NoMethodError.new("message", "foo", [1,2,3])
p nom.name
p nom.args
# => "foo"
[1, 2, 3]... -
Enumerator
. new(size=nil) {|y| . . . } -> Enumerator (18460.0) -
Enumerator オブジェクトを生成して返します。与えられたブロックは Enumerator::Yielder オブジェクトを 引数として実行されます。
...与えられたブロックは Enumerator::Yielder オブジェクトを
引数として実行されます。
生成された Enumerator オブジェクトに対して each を呼ぶと、この生成時に指定されたブロックを
実行し、Yielder オブジェクトに対して << メソ......
new に渡されたブロックが終了した時点で each の繰り返しが終わります。
このときのブロックの返り値が each の返り値となります。
@param size 生成する Enumerator オブジェクトの要素数を指定します。
Integer、Float::INF......INITY、Proc オブジェク
ト、nil のいずれかを指定します。Enumerator#size の実
行時に参照されます。
//emlist[例][ruby]{
enum = Enumerator.new{|y|
(1..10).each{|i|
y << i if i % 5 == 0
}
}
enum.each{|i| p i }
#=> 5
# 10
fib = Enumer... -
Hash
. new(ifnone = nil) -> Hash (18432.0) -
空の新しいハッシュを生成します。ifnone はキーに対 応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
...ます。ifnone はキーに対
応する値が存在しない時のデフォルト値です。設定したデフォルト値はHash#defaultで参照できます。
ifnoneを省略した Hash.new は {} と同じです。
デフォルト値として、毎回同一のオブジェクトifnoneを返......値にも影響します。
//emlist[][ruby]{
h = Hash.new([])
h[0] << 0
h[1] << 1
p h.default #=> [0, 1]
//}
これを避けるには、破壊的でないメソッドで再代入する必要が有ります。
また、このようなミスを防ぐためにもifnoneは freeze して破壊的操......作を禁止しておくのが無難です。
@param ifnone キーに対応する値が存在しない時のデフォルト値です。
//emlist[例][ruby]{
h = Hash.new([])
p h[1] #=> []
p h[1].object_id #=> 6127150
p h[1] << "bar" #=> ["bar"]
p h[1]...