るりまサーチ

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

別のキーワード

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

ライブラリ

クラス

キーワード

検索結果

<< < 1 2 3 4 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),...
<< < 1 2 3 4 5 > >>