るりまサーチ

最速Rubyリファレンスマニュアル検索!
99件ヒット [1-99件を表示] (0.095秒)
トップページ > クエリ:-[x] > クエリ:each_byte[x] > クエリ:first[x]

別のキーワード

  1. _builtin each
  2. _builtin each_line
  3. prime each
  4. each
  5. tsort tsort_each

ライブラリ

クラス

モジュール

キーワード

検索結果

Enumerable#first -> object | nil (18238.0)

Enumerable オブジェクトの最初の要素、もしくは最初の n 要素を返します。

...引数を指定しない形式では nil を返します。
引数を指定する形式では、空の配列を返します。

@param n 取得する要素数。

//emlist[例][ruby]{
e = "abcd".each_byte
e.first #=> 97
e.first(2) #=> [97,98]
e = "".each_byte
e.first #=> nil
e.first(2) #=> []
//}...

Enumerable#first(n) -> Array (18238.0)

Enumerable オブジェクトの最初の要素、もしくは最初の n 要素を返します。

...引数を指定しない形式では nil を返します。
引数を指定する形式では、空の配列を返します。

@param n 取得する要素数。

//emlist[例][ruby]{
e = "abcd".each_byte
e.first #=> 97
e.first(2) #=> [97,98]
e = "".each_byte
e.first #=> nil
e.first(2) #=> []
//}...

ruby 1.6 feature (5310.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...グ修正がメイン
になります。

((<stable-snapshot|URL:ftp://ftp.netlab.co.jp/pub/lang/ruby/stable-snapshot.tar.gz>)) は、日々更新される安定版の最新ソースです。

== 1.6.8 (2002-12-24) -> stable-snapshot

: 2003-01-22: errno

EAGAIN と EWOULDBLOCK が同じ値の...
...
((<ruby-bugs-ja:PR#231>))

p Regexp.quote("#")

p /a#{Regexp.quote("#")}b/x =~ "ab"

=> -:3: warning: ambiguous first argument; make sure
ruby 1.6.7 (2002-03-01) [i586-linux]
"#"
0

=> -:3: warning: ambiguous first argument; make...
...なった。

* IO#each_byte が self を返すようになった(以前は nil)

: rb_define_module_under()

C 関数 rb_define_module_under() でモジュールを定義するときに同名の定
数が既に定義されていると失敗していました。((<ruby-talk:30203>))

C...

ruby 1.8.2 feature (1284.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...されたクラス/メソッドなど
* [compat]: 変更されたクラス/メソッドなど
* 互換性のある変更
* only backward-compatibility
* 影響の範囲が小さいと思われる変更
* [change]: 変更されたクラス/メソッドなど(互換性のない...
...re/2003-07-19>)), ((<ruby 1.8 feature/2003-05-26>))、
((<ruby-dev:22851>))

=== 2004-02-09
: File.fnmatch [ruby] [bug]
適切にマッチしないバグを修正しました。
((<ruby-dev:22815>)) ((<ruby-dev:22819>))

=== 2004-02-06
: PrettyPrint#first? [lib] [obsolete]

=== 2004-02-05
: P...
...ruby-dev:22627>))

=== 2004-01-08
: OpenSSL::PKey::DH#to_der [lib] [new]
: OpenSSL::PKey::DSA#to_der [lib] [new]
: OpenSSL::PKey::RSA#to_der [lib] [new]


=== 2003-12-31
: ARGF.each_byte [ruby] [compat]
nil ではなく ARGF を返すようになりました。((<ruby-dev:22465>))

=== 2003-12-27...

NEWS for Ruby 2.0.0 (114.0)

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

...は参照情報があるため短いです。
十分な情報と共に書かれた全ての変更のリストは ChangeLog ファイルか bugs.ruby-lang.org の issue を参照してください。

== 1.9.3 以降の変更

=== 言語仕様の変更

* キーワード引数を追加しました...
...ionSequence#absolute_path,
RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#base_label,
RubyVM::InstructionSequence#first_lineno to retrieve information from where
the instruction sequence was defined.
* スタックの使用量を指定するための環境...
...nts, StringIO#bytes,
Zlib::GzipReader#lines, Zlib::GzipReader#bytes
* これらのメソッドは非推奨になりました。each_line, each_byte, each_char, each_codepoint を使ってください。

* Proc#==, m:Proc#eql?
* 削除されました。2つの Proc オブジェクト...

絞り込み条件を変える

Object#enum_for(method = :each, *args) -> Enumerator (112.0)

Enumerator.new(self, method, *args) を返します。

...かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@see Enumerator, Enumerator#size...

Object#enum_for(method = :each, *args) {|*args| ... } -> Enumerator (112.0)

Enumerator.new(self, method, *args) を返します。

...かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@see Enumerator, Enumerator#size...

Object#to_enum(method = :each, *args) -> Enumerator (112.0)

Enumerator.new(self, method, *args) を返します。

...かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@see Enumerator, Enumerator#size...

Object#to_enum(method = :each, *args) {|*args| ... } -> Enumerator (112.0)

Enumerator.new(self, method, *args) を返します。

...かシンボルです。
@param args 呼び出すメソッドに渡される引数です。

//emlist[][ruby]{
str = "xyz"

enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]

# protects an array from being modified
a = [1, 2, 3]
p(a.to_enum) #=> #<Enumerator: [1...
...each do |*val|
n.times { yield *val }
end
end
end

%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}

@see Enumerator, Enumerator#size...