るりまサーチ

最速Rubyリファレンスマニュアル検索!
137件ヒット [1-100件を表示] (0.036秒)

別のキーワード

  1. openssl new
  2. _builtin new
  3. rexml/document new
  4. resolv new
  5. socket new

ライブラリ

クラス

モジュール

検索結果

<< 1 2 > >>

NEWS for Ruby 2.7.0 (26078.0)

NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...NEWS for Ruby 2.7.0
このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

それぞれのエントリーは参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリス...
...ュメントの識別子の引用符は同じ行で閉じる必要があります。

//emlist{
<<"EOS
" # This had been warned since 2.4; Now it raises a SyntaxError
EOS
//}

* フリップフロップが非推奨になったのが元に戻されました。 5400

* 以下のような場所に...
...nd endless ranges:
-1.clamp(0..) #=> 0
3.clamp(..2) #=> 2
//}

* Complex
* 新規メソッド
* Complex#<=>が追加されました。
その結果、「0 <=> 0i」がNoMethodErrorを発生しなくなりました。 15857

* Dir
* 変更されたメソッド
* Dir...

1.6.8から1.8.0への変更点(まとめ) (24380.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...スのスーパークラスは同じなのだそうです
((<ruby-bugs-ja:324>))。さあっぱりわかりません(^^;;

class << Object.new
class << self.superclass
p [self.id, self]
end
class << self
p [self.superclass.id, self.supe...
...は Proc, Method オブジェクト限定でした。
これに伴い Proc#to_proc が追加されました。

: 終了ステータス [compat]

raise
SystemExit したときに終了ステータス 1 で終了するようになりました。
((<ruby-dev:16776>))

: ((<"rescue/ensure on begi...
...obj#<=> が nil を返すような引数に対して、>, >=, <, <= が例外
((<ArgumentError>)) を起こすようになりました。また、== は、nil を返
すようになりました。

: ((<Module/Module#>>)) [change]
: ((<Module/Module#<>)) [change]
: ((<Module/Module#<=>)) [cha...

Range.new(first, last, exclude_end = false) -> Range (18185.0)

first から last までの範囲オブジェクトを生成して返しま す。

...を含まない範囲オブジェクトを生成します

@raise ArgumentError first <=> last が nil の場合に発生します

//emlist[例: 整数の範囲オブジェクトの場合][ruby]{
Range.new(1, 10) # => 1..10
Range.new(1, 10, true) # => 1...10
//}

//emlist[例: 日付オブジ...
...by]{
require 'date'
Range.new(Date.today, Date.today >> 1).each {|d| puts d }
# => 2017-09-16
# 2017-09-17
# ...
# 2017-10-16
//}

//emlist[例: IPアドレスの範囲オブジェクトの場合][ruby]{
require 'ipaddr'
Range.new(IPAddr.new("192.0.2.1"), IPAddr.new("192.0.2.3")).each {|ip|...
...のオブジェクトの場合][ruby]{
MyInteger = Struct.new(:value) do
def succ
self.class.new(value + 1)
end

def <=>(other)
value <=> other.value
end

def to_s
value.to_s
end
end
Range.new(MyInteger.new(1), MyInteger.new(3)).each {|i| puts i }
# => 1
# 2
# 3
//}...

OpenSSL::BN#<=>(other) -> -1 | 0 | 1 (18172.0)

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。

...][ruby]{
require 'openssl'

OpenSSL::BN.new(5) <=> 5 # => 0

OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}

@param other 比較する整数
@raise TypeError 比較できないときに...

OpenSSL::BN#cmp(other) -> -1 | 0 | 1 (3072.0)

自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。

...][ruby]{
require 'openssl'

OpenSSL::BN.new(5) <=> 5 # => 0

OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) # => 1
//}

@param other 比較する整数
@raise TypeError 比較できないときに...

絞り込み条件を変える

Enumerable#max {|a, b| ... } -> object | nil (85.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),
Person.new("s...
...ato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]

# 年齢が最大、名前が最小
people.max { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person...
...:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}...

Enumerable#max(n) {|a, b| ... } -> Array (85.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),
Person.new("s...
...ato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]

# 年齢が最大、名前が最小
people.max { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person...
...:0x007fc54b0240a0 @name="sato", @age=55>
people.max(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fc54b0240a0 @name="sato", @age=55>, #<Person:0x007fc54c033ea0 @name="suzuki", @age=55>]
//}...

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

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

...ge = age
end
end

people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]

# 年齢が最小、...
...age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fd6f0824190 @name="tanaka", @age=11>

people.min(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fb5899ef4a8 @name="tanaka", @age=11>, #<Person:0x007fb5899ef728 @name="suzuki", @age=11>]
//}

@raise T...

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

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

...ge = age
end
end

people = [
Person.new("sato", 55),
Person.new("sato", 33),
Person.new("sato", 11),
Person.new("suzuki", 55),
Person.new("suzuki", 33),
Person.new("suzuki", 11),
Person.new("tanaka", 55),
Person.new("tanaka", 33),
Person.new("tanaka", 11)
]

# 年齢が最小、...
...age <=> y.age).nonzero? || y.name <=> x.name }
# => #<Person:0x007fd6f0824190 @name="tanaka", @age=11>

people.min(2) { |x, y| (x.age <=> y.age).nonzero? || y.name <=> x.name }
# => [#<Person:0x007fb5899ef4a8 @name="tanaka", @age=11>, #<Person:0x007fb5899ef728 @name="suzuki", @age=11>]
//}

@raise T...

Enumerable#max -> object | nil (30.0)

最大の要素、もしくは最大の n 要素が入った降順の配列を返します。 全要素が互いに <=> メソッドで比較できることを仮定しています。

...最大の要素、もしくは最大の n 要素が入った降順の配列を返します。
全要素が互いに <=> メソッドで比較できることを仮定しています。

引数を指定しない形式では要素が存在しなければ nil を返します。
引数を指定する形...

絞り込み条件を変える

<< 1 2 > >>