233件ヒット
[101-200件を表示]
(0.089秒)
別のキーワード
ライブラリ
- ビルトイン (173)
- erb (24)
-
fiddle
/ import (12) -
irb
/ xmp (12) - un (12)
クラス
- Binding (77)
- ERB (24)
- Method (36)
- Module (12)
- Proc (12)
- TracePoint (12)
- UnboundMethod (24)
モジュール
-
Fiddle
:: Importer (12) - Kernel (24)
キーワード
- === (6)
- [] (6)
-
bind
_ call (12) - binding (24)
- call (12)
- eval (12)
- httpd (12)
-
instance
_ method (12) -
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - receiver (11)
- result (12)
- run (12)
-
source
_ location (7) - unbind (12)
- xmp (12)
検索結果
先頭5件
-
Binding
# source _ location -> [String , Integer] (3023.0) -
self の Ruby のソースファイル名と行番号を返します。
...self の Ruby のソースファイル名と行番号を返します。
d:spec/variables#pseudo の __FILE__ と __LINE__ も参照してください。
//emlist[例][ruby]{
p binding.source_location # => ["test.rb", 1]
//}... -
Binding
# local _ variable _ defined?(symbol) -> bool (3013.0) -
引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。
...mlist[例][ruby]{
def foo
a = 1
binding.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}
このメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("defined?(#{symbol}) == 'local-variable'")
//}
@see Binding#local_......variable_get, Binding#local_variable_set... -
Binding
# local _ variable _ get(symbol) -> object (3013.0) -
引数 symbol で指定した名前のローカル変数に設定された値を返します。
...//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_get(:a) # => 1
binding.local_variable_get(:b) # => NameError
end
//}
このメソッドは以下のコードの短縮形です。
//emlist[][ruby]{
binding.eval("#{symbol}")
//}
@see Binding#local_variable_set, Binding#local_variab... -
Binding
# local _ variables -> [Symbol] (3013.0) -
ローカル変数の一覧を Symbol の配列で返します。
...カル変数の一覧を Symbol の配列で返します。
//emlist[例][ruby]{
def foo
a = 1
2.times do |n|
binding.local_variables #=> [:a, :n]
end
end
//}
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("local_variables")
//}... -
Binding
# receiver -> object (3007.0) -
保持するコンテキスト内での self を返します。
...保持するコンテキスト内での self を返します。
このメソッドは以下のコードと同様の動作をします。
//emlist[][ruby]{
binding.eval("self")
//}... -
Kernel
# xmp(exps , bind = nil) -> XMP (130.0) -
引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行 ごとに交互に表示します。
...引数 exps で指定されたRuby のソースコードとその実行結果を、標準出力に行
ごとに交互に表示します。
@param exps 評価するRuby のソースコードを文字列で指定します。
@param bind Binding オブジェクトを指定します。省略した場......合は、最
後に実行した XMP#puts、Kernel#xmp の
Binding を使用します。まだ何も実行していない場合は
Object::TOPLEVEL_BINDING を使用します。... -
ERB
# result(b=TOPLEVEL _ BINDING) -> String (107.0) -
ERB を b の binding で実行し、結果の文字列を返します。
...ERB を b の binding で実行し、結果の文字列を返します。
@param b eRubyスクリプトが実行されるときのbinding
//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
puts erb.result
# test foo
# test bar
//... -
ERB
# run(b=TOPLEVEL _ BINDING) -> nil (107.0) -
ERB を b の binding で実行し、結果を標準出力へ印字します。
...ERB を b の binding で実行し、結果を標準出力へ印字します。
@param b eRubyスクリプトが実行されるときのbinding
//emlist[例][ruby]{
require 'erb'
erb = ERB.new("test <%= test1 %>\ntest <%= test2 %>\n")
test1 = "foo"
test2 = "bar"
erb.run
# test foo
# test bar
//}... -
Kernel
# httpd -> () (13.0) -
WEBrick HTTP server を起動します。
...WEBrick HTTP server を起動します。
ruby -run -e httpd -- [OPTION] [DocumentRoot]
--bind-address=ADDR バインドアドレスを指定します
--port=NUM ポート番号を指定します
--max-clients=MAX 同時接続数の最大値
--temp-dir... -
Method
# ===(*args) -> object (13.0) -
メソッドオブジェクトに封入されているメソッドを起動します。
...メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
@see spec/safelevel
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1]......他の [] メソッドとの意味的な関連性はありません。
@param args self に渡される引数。
@see UnboundMethod#bind_call
//emlist[例][ruby]{
class Foo
def foo(arg)
"foo called with arg #{arg}"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m[1] # =>...