別のキーワード
ライブラリ
- ビルトイン (372)
- erb (12)
-
fiddle
/ import (12) - json (12)
- win32ole (24)
クラス
- BasicObject (84)
- Class (12)
- ERB (12)
- Object (132)
-
Thread
:: Backtrace :: Location (48) -
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (12)
モジュール
- Enumerable (96)
-
Fiddle
:: Importer (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12)
キーワード
- ! (12)
- != (12)
- == (12)
-
_ dump (12) -
absolute
_ path (12) - allocate (12)
-
base
_ label (12) - clone (12)
-
def
_ class (12) -
default
_ event _ sources (12) - dup (12)
- handler= (12)
-
initialize
_ copy (12) - inspect (24)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
marshal
_ dump (12) - max (48)
-
method
_ missing (12) - min (48)
-
singleton
_ method (12) - struct (12)
-
to
_ json (12) -
to
_ s (24)
検索結果
先頭5件
-
Object
# to _ s -> String (43.0) -
オブジェクトの文字列表現を返します。
...ッドを使って文字列に変換し
ます。
//emlist[][ruby]{
class Foo
def initialize num
@num = num
end
end
it = Foo.new(40)
puts it #=> #<Foo:0x2b69110>
class Foo
def to_s
"Class:Foo Number:#{@num}"
end
end
puts it #=> Class:Foo Number:40
//}
@see Object#to_str,Kernel.#... -
Thread
:: Backtrace :: Location # base _ label -> String (43.0) -
self が表すフレームの基本ラベルを返します。通常、 Thread::Backtrace::Location#label から修飾を取り除いたもので構成 されます。
...ので構成
されます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.base_label
end
# => initialize
# new
# <main>
//}
@see Thread::Backtrace::Loc... -
Thread
:: Backtrace :: Location # inspect -> String (43.0) -
Thread::Backtrace::Location#to_s の結果を人間が読みやすいような文 字列に変換したオブジェクトを返します。
...トを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.inspect
end
# => "path/to/foo.rb:5:in `initialize'"
# "path/to/foo.rb:9:in `new'"
# "... -
Thread
:: Backtrace :: Location # to _ s -> String (43.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
...列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo.rb:9:in `new'
# path/to... -
BasicObject
# !=(other) -> bool (37.0) -
オブジェクトが other と等しくないことを判定します。
...オブジェクト
@see BasicObject#==, BasicObject#!
//emlist[例][ruby]{
class NonequalityRecorder < BasicObject
def initialize
@count = 0
end
attr_reader :count
def !=(other)
@count += 1
super
end
end
recorder = NonequalityRecorder.new
recorder != 1
puts 'hoge' if recorde... -
Class
# allocate -> object (37.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...ェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initialized? #=> false
//}... -
Thread
:: Backtrace :: Location # absolute _ path -> String (37.0) -
self が表すフレームの絶対パスを返します。
...ムの絶対パスを返します。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.absolute_path
end
# => /path/to/foo.rb
# /path/to/foo.rb
# /path/to/fo... -
Enumerable
# max {|a , b| . . . } -> object | nil (33.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...eError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),... -
Enumerable
# max(n) {|a , b| . . . } -> Array (33.0) -
ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。
...eError ブロックが整数以外を返したときに発生します。
//emlist[例][ruby]{
class Person
attr_reader :name, :age
def initialize(name, age)
@name = name
@age = age
end
end
people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),...