850件ヒット
[1-100件を表示]
(0.029秒)
ライブラリ
クラス
- Array (19)
- BasicSocket (11)
- CGI (11)
-
Digest
:: Base (11) - Exception (11)
-
Fiddle
:: Function (11) - GDBM (11)
- Matrix (99)
-
Net
:: FTP :: MLSxEntry (9) - Object (11)
-
OpenSSL
:: BN (11) - OpenStruct (11)
-
REXML
:: Attribute (11) -
REXML
:: Instruction (11) - Regexp (11)
-
RubyVM
:: InstructionSequence (44) - SDBM (11)
- String (314)
- StringScanner (11)
- Struct (22)
- Symbol (33)
- TrueClass (33)
キーワード
- & (11)
- +@ (9)
- -@ (9)
- === (22)
-
NEWS for Ruby 3
. 0 . 0 (4) - Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- String (11)
- [] (66)
- ^ (11)
-
backtrace
_ locations (11) - clone (11)
- crypt (11)
- dedup (2)
- disasm (22)
- disassemble (22)
- downcase (8)
- dump (11)
- eigen (11)
- eigensystem (11)
- empty (11)
- encode64 (11)
- eql? (22)
- file? (9)
- find (20)
-
generate
_ prime (11) - getpeername (11)
- getrlimit (11)
- hash (11)
- header (11)
- id2name (11)
- intern (11)
- lup (11)
-
lup
_ decomposition (11) - new (39)
- pack (19)
- readline (11)
- rect (11)
- rectangular (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 9 feature (11) - select (22)
- slice (66)
- split (17)
- string (11)
- sum (11)
-
to
_ s (11) -
to
_ sym (11) - tracer (11)
-
unicode
_ normalize! (10) - unpack (11)
- | (11)
- 制御構造 (11)
検索結果
先頭5件
-
tracer (26006.0)
-
実行トレース出力をとる機能を提供します。
...ruby -rtracer hoge.rb
もうひとつはソースからrequireする方法です。
require 'tracer'
とした後
Tracer.on
によりトレース出力を有効にします。
Tracer.off
によりトレース出力を無効にします。
また、ブロック付きで Tracer.on......。
=== サンプルコード
# 例: 式の評価の中でHogeクラスのメソッドが呼び出される時、トレースする。
# ruby 1.8 では警告がでますが、動作します。
require 'tracer'
class Hoge
def Hoge.fuga(i)
"fuga #{i}"
end
end
Tracer.ad......d_filter {|event, file, line, id, binding, klass|
event =~ /line/ and klass.to_s =~ /hoge/i
}
Tracer.on
for i in 0..3
puts Hoge.fuga(i) if i % 3 == 0
end
Tracer.off
=== SEE ALSO
Kernel.#set_trace_func... -
String
# ==(other) -> bool (21124.0) -
other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
...other が文字列の場合、String#eql? と同様に文字列の内容を比較します。
other が文字列でない場合、
other.to_str が定義されていれば
other == self の結果を返します。(ただし、 other.to_str は実行されません。)
そうでなければ false......return true か false
//emlist[例][ruby]{
stringlike = Object.new
def stringlike.==(other)
"string" == other
end
p "string".eql?(stringlike) #=> false
p "string" == stringlike #=> false
def stringlike.to_str
raise
end
p "string".eql?(stringlike) #=> false
p "string" == stringlik......e #=> true
//}
@see String#eql?... -
Struct
# ==(other) -> bool (21122.0) -
self と other のクラスが同じであり、各メンバが == メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...同じであり、各メンバが == メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Struct.new(:name, :age)
dog1 = Dog.new(......d", 5)
p dog1 == dog2 #=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位......クラスを作成する点に
注意してください。
@see Struct#eql?... -
Matrix
# ==(other) -> bool (21100.0) -
自分自身と other を比較し、同値であれば真(true)を返します。
...自分自身と other を比較し、同値であれば真(true)を返します。
@param other 比較対象のオブジェクト... -
OpenStruct
# ==(other) -> bool (21100.0) -
自身と比較対象のオブジェクトが等しい場合に真を返します。 そうでない場合は、偽を返します。
自身と比較対象のオブジェクトが等しい場合に真を返します。
そうでない場合は、偽を返します。
@param other 比較対象のオブジェクトを指定します。 -
REXML
:: Attribute # ==(other) -> bool (21100.0) -
属性の名前と値が other と一致する場合に真を返します。
属性の名前と値が other と一致する場合に真を返します。 -
REXML
:: Instruction # ==(other) -> bool (21100.0) -
other と self が同じ 処理命令である場合に真を返します。
...other と self が同じ 処理命令である場合に真を返します。
同じとは、 REXML::Instruction#target と REXML::Instruction#content
が一致することを意味します。
@param other 比較対象... -
Symbol
# ==(other) -> true | false (18212.0) -
other が同じシンボルの時に真を返します。 そうでない場合は偽を返します。
...other が同じシンボルの時に真を返します。
そうでない場合は偽を返します。
@param other 比較対象のシンボルを指定します。
例:
:aaa == :aaa #=> true
:aaa == :xxx #=> false... -
Digest
:: Base # ==(str) -> bool (18208.0) -
与えられた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。
...られた文字列を hexdigest 値と見て、自身の hexdigest 値と比較します。
@param str 比較対象の hexdigest 文字列
require 'digest/md5'
digest = Digest::MD5.new
digest.update("ruby")
p digest == "58e53d1324eef6265fdb97b08ed9aadf" # => true... -
Regexp
# ===(string) -> bool (12300.0) -
文字列 string との正規表現マッチを行います。 マッチした場合は真を返します。
...文字列 string との正規表現マッチを行います。
マッチした場合は真を返します。
string が文字列でもシンボルでもない場合には false を返します。
このメソッドは主にcase文での比較に用いられます。
@param string マッチ対象......文字列
//emlist[例][ruby]{
a = "HELLO"
case a
when /\A[a-z]*\z/; puts "Lower case"
when /\A[A-Z]*\z/; puts "Upper case"
else; puts "Mixed case"
end
# => Upper case
/\A[a-z]*\z/ === "HELLO" # => false
/\A[A-Z]*\z/ === "HELLO" # => true
//}
@see Enumerable#grep, Object#===...