種類
- インスタンスメソッド (45)
- 文書 (26)
- 特異メソッド (16)
クラス
- Date (33)
- Enumerator (5)
- Range (23)
キーワード
-
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - cover? (12)
- new (11)
- next (11)
-
next
_ day (11) - produce (5)
-
ruby 1
. 6 feature (11)
検索結果
先頭5件
-
Date
# succ -> Date (32203.0) -
翌日の日付オブジェクトを返します。
翌日の日付オブジェクトを返します。 -
Date
# next _ day(n = 1) -> Date (17113.0) -
n 日後を返します。
...n 日後を返します。
Date#succ も参照してください。
@param n 日数... -
Date
# next -> Date (17103.0) -
翌日の日付オブジェクトを返します。
翌日の日付オブジェクトを返します。 -
Range
# cover?(obj) -> bool (73.0) -
obj が範囲内に含まれている時に true を返します。
...emlist[Date, DateTime の例][ruby]{
require 'date'
(Date.today - 365 .. Date.today + 365).include?(Date.today) #=> true
(Date.today - 365 .. Date.today + 365).include?(DateTime.now) #=> false
(Date.today - 365 .. Date.today + 365).cover?(Date.today) #=> true
(Date.today - 365 .. Date.today......+ 365).cover?(DateTime.now) #=> true
//}... -
ruby 1
. 6 feature (48.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...ruby '-*' -v
=> ruby 1.6.7 (2002-03-01) [i586-linux]
=> ruby: invalid option -* (-h will show valid options)
: 2002-05-22 parsedate
バージョンアップ((<ruby-dev:17171>))
: 2002-05-22 -T オプション
ruby のコマンドラインオプション -T の後に空白......ify frozen Time (TypeError)
from -:3
: File::SEPARATOR
: File::ALT_SEPARATOR
: File::PATH_SEPARATOR
: RUBY_PLATFORM
: RUBY_RELEASE_DATE
: RUBY_VERSION
これらは、freeze された文字列になりました。
p File::SEPARATOR.frozen?
p File::ALT_SEPARATOR.fr......5 (2001-11-01) [i586-linux]
1
2
: String#succ
((<ruby-talk:22557>))
p "***".succ
p "*".succ
p sprintf("%c", 255).succ
p sprintf("*%c", 255).succ
p sprintf("**%c", 255).succ
=> ruby 1.6.5 (2001-09-19) [i586-linux]
"*... -
NEWS for Ruby 2
. 7 . 0 (42.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...デフォルト実装から
lazyになりました。7877
//emlist[Enumerator.produce][ruby]{
require "date"
dates = Enumerator.produce(Date.today, &:succ) #=> infinite sequence of dates
dates.detect(&:tuesday?) #=> next Tuesday
//}
//emlist[Enumerator::Lazy#eager][ruby]{
a = %w(foo bar baz)
e = a....../ruby/ruby/pull/2226
* CSV
* 3.1.2に更新されました。
https://github.com/ruby/csv/blob/master/NEWS.md
* Date
* Date.jisx0301, Date#jisx0301, Date.parseが新しい日本の年号を
サポートしました。 15742
* Delegator
* Object#DelegateClassがブロ... -
Enumerator
. produce(initial = nil) { |prev| . . . } -> Enumerator (24.0) -
与えられたブロックを呼び出し続ける、停止しない Enumerator を返します。 ブロックの戻り値が、次にブロックを呼び出す時に引数として渡されます。 initial 引数が渡された場合、最初にブロックを呼び出す時にそれがブロック 呼び出しの引数として渡されます。initial が渡されなかった場合は nil が 渡されます。
...る値です。任意のオブジェクトを渡せます。
//emlist[例][ruby]{
# 1, 2, 3, 4, ... と続く Enumerator
Enumerator.produce(1, &:succ)
# next を呼ぶたびランダムな数値を返す Enumerator
Enumerator.produce { rand(10) }
# ツリー構造の祖先ノードを列挙する......るでしょう。
//emlist[Enumerable のメソッドと組み合わせる例][ruby]{
# 次の火曜日を返す例
require "date"
Enumerator.produce(Date.today, &:succ).detect(&:tuesday?)
# シンプルなレキサーの例
require "strscan"
scanner = StringScanner.new("7+38/6")
PATTERN = %r{\d+... -
Range
. new(first , last , exclude _ end = false) -> Range (24.0) -
first から last までの範囲オブジェクトを生成して返しま す。
...0
Range.new(1, 10, true) # => 1...10
//}
//emlist[例: 日付オブジェクトの範囲オブジェクトの場合][ruby]{
require 'date'
Range.new(Date.today, Date.today >> 1).each {|d| puts d }
# => 2017-09-16
# 2017-09-17
# ...
# 2017-10-16
//}
//emlist[例: IPアドレスの範囲オ......# => 192.0.2.1
# 192.0.2.2
# 192.0.2.3
//}
//emlist[例: 自作のオブジェクトの場合][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... -
NEWS for Ruby 3
. 0 . 0 (18.0) -
NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...the value.
16754
=== `--backtrace-limit` option
The `--backtrace-limit` option limits the maximum length of a backtrace.
8661
== Core classes updates
Outstanding ones only.
* Array
* The following methods now return Array instances instead of subclass instances when called on subclass in......* String#slice!
* String#slice / String#[]
* String#split
* String#squeeze
* String#strip
* String#sub
* String#succ / String#next
* String#swapcase
* String#tr
* String#tr_s
* String#upcase
* Symbol
* Symbol#to_proc now returns a lam......updates
Outstanding ones only.
* BigDecimal
* Update to BigDecimal 3.0.0
* This version is Ractor compatible.
* Bundler
* Update to Bundler 2.2.3
* CGI
* Update to 0.2.0
* This version is Ractor compatible.
* CSV
* Update to CSV 3.1.9
* Date
* Update to Date 3... -
Range
# cover?(range) -> bool (18.0) -
2.6 以降の cover? は、Range#include? や Range#=== と異なり、 引数に Range オブジェクトを指定して比較できます。
...引数に渡されており、
「a <= c && b < d」を満たし、cが数値ではない(つまり引数の Range の終端を
求めるために succ メソッドの呼び出しが必要な)場合、パフォーマンスの問題が起きる可能性があります。
//emlist[パフォーマン... -
NEWS for Ruby 2
. 6 . 0 (12.0) -
NEWS for Ruby 2.6.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...と :order を受け付けるようになりました。 14324
* Hash
* 変更されたメソッド
* Hash#merge, Hash#merge!, Hash#update が引数を複数受け付けるようになりました。 15111
* Hash#to_h はブロックを受け取りキーと値のペアを新し......スタ (/\X/) アルゴリズムの書き換えと String#downcase での
Georgian MTAVRULI の special-casing を含みます。
* Update Emoji version from 5.0 to 11.0.0 14802
* RubyVM::AbstractSyntaxTree
* 新規メソッド
* RubyVM::AbstractSyntaxTree.parse は文字......ット文字列と同様に
タイムゾーンオブジェクトを受け付けるようになりました。Time#+,
Time#-, Time#succ もタイムゾーンを維持します。 14850
* TracePoint
* 新機能
* "script_compiled" イベントがサポートされました...