904件ヒット
[1-100件を表示]
(0.064秒)
ライブラリ
クラス
- Class (11)
- Data (8)
-
Digest
:: Base (11) -
Enumerator
:: Lazy (11) - Exception (11)
-
Fiddle
:: Closure :: BlockCaller (11) -
File
:: Stat (22) - Hash (23)
- LocalJumpError (22)
- Method (11)
-
Net
:: HTTP (22) - Object (55)
- OpenStruct (12)
- OptionParser (22)
- Proc (18)
-
Psych
:: Nodes :: Mapping (22) -
Psych
:: Nodes :: Sequence (22) - Set (22)
- Shell (36)
-
Shell
:: CommandProcessor (12) -
Shell
:: Filter (18) - Socket (11)
- Struct (56)
- Thread (57)
-
Thread
:: Queue (33) -
Thread
:: SizedQueue (33) - ThreadsWait (6)
- TracePoint (6)
- UDPSocket (11)
- UNIXServer (11)
モジュール
- Enumerable (44)
- Kernel (35)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 2 . 0 (10) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - Proc (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- [] (11)
-
accept
_ nonblock (11) - backtrace (11)
-
backtrace
_ locations (33) -
block
_ length (11) - blockdev? (11)
- blocks (11)
- cd (6)
- chdir (6)
-
connect
_ nonblock (11) -
default
_ proc (11) - define (4)
- deq (22)
- divide (22)
- each (6)
-
each
_ entry (22) -
enum
_ for (22) -
exit
_ value (11) - foreach (18)
- initialize (11)
-
instruction
_ sequence (6) - lambda (17)
-
net
/ smtp (11) -
next
_ wait (6) -
on
_ head (11) -
on
_ tail (11) - out (18)
- parameters (11)
- pop (22)
- proc (18)
- pushd (6)
- pushdir (6)
-
rdoc
/ parser / c (11) - reason (11)
-
recvfrom
_ nonblock (11) -
report
_ on _ exception (16) -
report
_ on _ exception= (8) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby 1
. 9 feature (11) - shift (22)
- start (22)
-
to
_ enum (22) -
to
_ h (40) -
to
_ set (22) - tsort (11)
- クラス/メソッドの定義 (11)
- メソッド呼び出し(super・ブロック付き・yield) (11)
- 制御構造 (11)
- 手続きオブジェクトの挙動の詳細 (11)
検索結果
先頭5件
- Fiddle
:: Closure :: BlockCaller . new(ret , args , abi=Fiddle :: Function :: DEFAULT) { . . . } -> Fiddle :: Closure :: BlockCaller - Class
# new(*args , &block) -> object - Psych
:: Nodes :: Mapping . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Mapping - Psych
:: Nodes :: Sequence . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Sequence - Proc
. new -> Proc
-
Fiddle
:: Closure :: BlockCaller . new(ret , args , abi=Fiddle :: Function :: DEFAULT) { . . . } -> Fiddle :: Closure :: BlockCaller (21307.0) -
Ruby のブロックを呼び出す Fiddle::Closure オブジェクトを返します。
...ddle::Closure オブジェクトを返します。
args、ret で関数の引数と返り値の型を指定します。
指定は Fiddle::Function.new と同様なので、そちら
を参照してください。
@param ret 返り値の型
@param args 引数の型を表す配列
@param abi 呼出... -
Class
# new(*args , &block) -> object (18326.0) -
自身のインスタンスを生成して返します。 このメソッドの引数はブロック引数も含め Object#initialize に渡されます。
...も含め Object#initialize に渡されます。
new は Class#allocate でインスタンスを生成し、
Object#initialize で初期化を行います。
@param args Object#initialize に渡される引数を指定します。
@param block Object#initialize に渡されるブロックを指......定します。
//emlist[例][ruby]{
# Class クラスのインスタンス、C クラスを生成
C = Class.new # => C
# Class クラスのインスタンス、C クラスのインスタンスを生成
C.new # => #<C:0x00005623f8b4e458>
//}... -
Psych
:: Nodes :: Mapping . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Mapping (18308.0) -
新たな mapping オブジェクトを生成します。
...上の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Mapping::ANY
* Psych::Nodes::Mapping::BLOCK
* Psych::Nodes::Mapping::FLOW
@param anchor mapping に付加された anchor
@param tag mapping に付加された tag
@param implicit mapping... -
Psych
:: Nodes :: Sequence . new(anchor=nil , tag=nil , implicit=true , style=BLOCK) -> Psych :: Nodes :: Sequence (18308.0) -
新たな sequence オブジェクトを生成します。
...の style を整数で指定します。以下のいずれ
かを指定できます。
* Psych::Nodes::Sequence::ANY
* Psych::Nodes::Sequence::BLOCK
* Psych::Nodes::Sequence::FLOW
@param anchor sequence に付加された anchor
@param tag sequence に付加された tag
@param implicit seque... -
Proc
. new -> Proc (18256.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しなければ、このメ......ブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}
これは以下と同じです。
//emlist[例][ruby]{
def foo
yield(1)
end
foo {|arg| p arg }
#......umentError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクト... -
Proc
. new { . . . } -> Proc (18256.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
が発生します。
ブロックを指定しなければ、このメ......ブロックがないのにブロックを省略した呼び出しを行ったときに発生します。
//emlist[例][ruby]{
def foo
pr = Proc.new
pr.call(1)
end
foo {|arg| p arg }
# => 1
//}
これは以下と同じです。
//emlist[例][ruby]{
def foo
yield(1)
end
foo {|arg| p arg }
#......umentError が発生します。
//emlist[例][ruby]{
def foo
Proc.new
end
foo
# => -:2:in `new': tried to create Proc object without a block (ArgumentError)
# from -:2:in `foo'
# from -:4:in `<main>'
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクト......を行ったときに発生します。
//emlist[][ruby]{
pr = Proc.new {|arg| p arg }
pr.call(1) # => 1
//}
//emlist[][ruby]{
Proc.new # => -e:1:in `new': tried to create Proc object without a block (ArgumentError)
//}
Proc.new は、Proc#initialize が定義されていれば
オブジェクト... -
Enumerator
:: Lazy . new(obj , size=nil) {|yielder , *values| . . . } -> Enumerator :: Lazy (18225.0) -
Lazy Enumerator を作成します。Enumerator::Lazy#force メソッドなどに よって列挙が実行されたとき、objのeachメソッドが実行され、値が一つずつ ブロックに渡されます。ブロックは、yielder を使って最終的に yield される値を 指定できます。
...e#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 result
end
e......nd
end
1.step.lazy.filter_map{|i| i*i if i.even?}.first(5)
# => [4, 16, 36, 64, 100]
//}
@raise ArgumentError 引数を指定しなかった場合、ブロックを指定しなかった場合に発生します。
@see Enumerator.new... -
Psych
:: Nodes :: Mapping :: BLOCK -> Integer (18223.0) -
block style を表します。
...block style を表します。
@see Psych::Nodes::Mapping.new,
Psych::Nodes::Mapping#style,
Psych::Handler#start_mapping... -
Psych
:: Nodes :: Sequence :: BLOCK -> Integer (18223.0) -
block style を表します。
...block style を表します。
@see Psych::Nodes::Sequence.new,
Psych::Nodes::Sequence#style,
Psych::Handler#start_sequence... -
Struct
. new(*args , keyword _ init: nil) {|subclass| block } -> Class (15516.0) -
Struct クラスに新しいサブクラスを作って、それを返します。
...では構造体のメンバに対するアクセスメソッドが定義されています。
//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}
実装の都合......emlist[例][ruby]{
Point = Struct.new(:x, :y, keyword_init: true) # => Point(keyword_init: true)
Point.new(x: 1, y: 2) # => #<struct Point x=1, y=2>
Point.new(x: 1) # => #<struct Point x=1, y=nil>
Point.new(y: 2) # => #<struct Point x=nil, y=2>
Point.new(z: 3) # ArgumentError (unkn......{
Point = Struct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).
# keywor......Point1 = Struct.new(:x, :y)
Point1.new(1, 2) # => #<struct Point1 x=1, y=2>
Point1.new(x: 1, y: 2) # => #<struct Point1 x=1, y=2>
Point1.new(x: 1) # => #<struct Point1 x=1, y=nil>
Point1.new(y: 2) # => #<struct Point1 x=nil, y=2>
Point1.new(x: 1, y: 2, z: 3......Struct.new(:x, :y, keyword_init: nil)
Point2.new(1, 2) # => #<struct Point2 x=1, y=2>
Point2.new(x: 1, y: 2) # => #<struct Point2 x=1, y=2>
Point2.new(x: 1) # => #<struct Point2 x=1, y=nil>
Point2.new(y: 2) # => #<struct Point2 x=nil, y=2>
Point2.new(x: 1,... -
Struct
. new(*args , keyword _ init: nil) -> Class (15416.0) -
Struct クラスに新しいサブクラスを作って、それを返します。
...では構造体のメンバに対するアクセスメソッドが定義されています。
//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "name:%s age:%d", fred.name, fred.age
#=> "name:fred age:6" を出力します
//}
実装の都合......Point1 = Struct.new(:x, :y)
Point1.new(1, 2) # => #<struct Point1 x=1, y=2>
Point1.new(x: 1, y: 2) # => #<struct Point1 x=1, y=2>
Point1.new(x: 1) # => #<struct Point1 x=1, y=nil>
Point1.new(y: 2) # => #<struct Point1 x=nil, y=2>
Point1.new(x: 1, y: 2, z: 3......Struct.new(:x, :y, keyword_init: nil)
Point2.new(1, 2) # => #<struct Point2 x=1, y=2>
Point2.new(x: 1, y: 2) # => #<struct Point2 x=1, y=2>
Point2.new(x: 1) # => #<struct Point2 x=1, y=nil>
Point2.new(y: 2) # => #<struct Point2 x=nil, y=2>
Point2.new(x: 1,...