49件ヒット
[1-49件を表示]
(0.066秒)
ライブラリ
- ビルトイン (19)
-
shell
/ command-processor (6) - tracer (24)
クラス
- Proc (19)
-
Shell
:: CommandProcessor (6) - Tracer (24)
キーワード
- new (19)
-
set
_ get _ line _ procs (24)
検索結果
先頭5件
-
Proc
. new -> Proc (21163.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...OSE = 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 ar......ror が発生します。
//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 (21163.0) -
ブロックをコンテキストとともにオブジェクト化して返します。
...OSE = 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 ar......ror が発生します。
//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 が定義されていれば
オブジェクトの初期......化のためにこれを呼び出します。このことを
除けば、Kernel.#proc と同じです。... -
Shell
:: CommandProcessor . initialize -> () (21102.0) -
@todo
@todo
このクラスを初期化します。 -
Tracer
. set _ get _ line _ procs(filename , proc) (6214.0) -
あるファイルについて利用する、行番号からソースのその行の内容を返す 手続きを指定します。何も指定しなければデフォルトの動作が利用されます。 指定する手続きは行番号を唯一の引数として呼び出されます。
...所を文字列で指定します。
@param proc 通常、文字列を返す手続きオブジェクトを指定します。
# 例 dummy.rb の3行目から6 行目のトレース出力に !! をつける
require 'tracer'
Tracer.set_get_line_procs('./dummy.rb'){|line|
str = "\n"
str......= "!!\n" if line >= 3 and line <= 6
str
}
Tracer.on
require 'dummy'
dm = Dummy.new
puts dm.number
=begin
# dummy.rb
class Dummy
def initialize
@number = 135
end
attr :number
end
=end... -
Tracer
. set _ get _ line _ procs(filename) {|line| . . . . } (6114.0) -
あるファイルについて利用する、行番号からソースのその行の内容を返す 手続きを指定します。何も指定しなければデフォルトの動作が利用されます。 指定する手続きは行番号を唯一の引数として呼び出されます。
...所を文字列で指定します。
@param proc 通常、文字列を返す手続きオブジェクトを指定します。
# 例 dummy.rb の3行目から6 行目のトレース出力に !! をつける
require 'tracer'
Tracer.set_get_line_procs('./dummy.rb'){|line|
str = "\n"
str......= "!!\n" if line >= 3 and line <= 6
str
}
Tracer.on
require 'dummy'
dm = Dummy.new
puts dm.number
=begin
# dummy.rb
class Dummy
def initialize
@number = 135
end
attr :number
end
=end...