るりまサーチ

最速Rubyリファレンスマニュアル検索!
492件ヒット [201-300件を表示] (0.047秒)

別のキーワード

  1. fiddle ruby_free
  2. rbconfig ruby
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

検索結果

<< < 1 2 3 4 5 > >>

Thread::Backtrace::Location#to_s -> String (25.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...

Enumerable#max {|a, b| ... } -> object | nil (21.0)

ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...る要素数。

@raise TypeError ブロックが整数以外を返したときに発生します。

//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),...

Enumerable#max(n) {|a, b| ... } -> Array (21.0)

ブロックの評価結果で各要素の大小判定を行い、最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...る要素数。

@raise TypeError ブロックが整数以外を返したときに発生します。

//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),...

Enumerable#min {|a, b| ... } -> object | nil (21.0)

ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...数存在する場合、どの要素を返すかは不定です。

@param n 取得する要素数。


//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),...

Enumerable#min(n) {|a, b| ... } -> Array (21.0)

ブロックの評価結果で各要素の大小判定を行い、最小の要素、もしくは最小の n 要素が昇順で入った配列を返します。 引数を指定しない形式では要素が存在しなければ nil を返します。 引数を指定する形式では、空の配列を返します。

...数存在する場合、どの要素を返すかは不定です。

@param n 取得する要素数。


//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),...

絞り込み条件を変える

BasicObject#!=(other) -> bool (19.0)

オブジェクトが other と等しくないことを判定します。

...います。

@param 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 = NonequalityRe...

BasicObject#==(other) -> bool (19.0)

オブジェクトが other と等しければ真を、そうでない場合は偽を返します。

...象となるオブジェクト
@return other が self と同値であれば真、そうでない場合は偽

//emlist[例][ruby]{
class Person < BasicObject
def initialize(name, age)
@name = name
@age = age
end
end

tanaka1 = Person.new("tanaka", 24)
tanaka2 = Person.new("tanaka", 24)...

BasicObject#instance_exec(*args) {|*vars| ... } -> object (19.0)

与えられたブロックをレシーバのコンテキストで実行します。

...数にアクセスすることができます。

@param args ブロックパラメータに渡す値です。

//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x }...

Class#allocate -> object (19.0)

自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。

...ェクトは
自身のインスタンスであること以外には何も特性を持ちません。

//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end

def initialized?
@initialized || false
end
end

klass.allocate.initialized? #=> false
//}...
<< < 1 2 3 4 5 > >>