るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

モジュール

オブジェクト

キーワード

検索結果

<< < 1 2 3 4 5 ... > >>

BasicObject#singleton_method_removed(name) -> object (17202.0)

特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。

...ドが Module#remove_method に
より削除された時にインタプリタから呼び出されます。

通常のメソッドの削除に対するフックには
Module#method_removedを使います。

@param name 削除されたメソッド名が Symbol で渡されます。

//emlist[例][ru...
...def singleton_method_removed(name)
puts "singleton method \"#{name}\" was removed"
e
nd
e
nd

obj = Foo.new
def obj.foo
e
nd

class << obj
remove_method :foo
e
nd

#=> singleton method "foo" was removed
//}

@see Module#method_removed,BasicObject#singleton_method_added,BasicObject#singleton_met...
...hod_undefined...

BasicObject#singleton_method_undefined(name) -> object (17202.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

...特異メソッドが Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。

通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。

@param name 未定義にされたメソッド名...
.../emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
e
nd
e
nd

obj = Foo.new
def obj.foo
e
nd
def obj.bar
e
nd

class << obj
undef_method :foo
e
nd
obj.instance_eval {undef bar}

#=> singleton method "foo" was undefined
# single...
...ton method "bar" was undefined
//}

@see Module#method_undefined,BasicObject#singleton_method_added,BasicObject#singleton_method_removed , d:spec/def#undef...

Encoding::Converter.asciicompat_encoding(string) -> Encoding | nil (17202.0)

同じ文字集合を持つ ASCII 互換エンコーディングを返します。

...集合を持つ ASCII 互換エンコーディングを返します。

@param string エンコーディング名
@param encoding エンコーディングオブジェクト
@return ASCII 互換エンコーディングのオブジェクトか nil

引数とエンコーディングと同じ文字集...
...ングでない場合は nil を返します。

//emlist[][ruby]{
E
ncoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
E
ncoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
E
ncoding::Converter.asciicompat_encoding("UTF-8") #=> nil
//}...

Encoding::MACCENTEURO -> Encoding (17202.0)

MacCentEuro エンコーディング。

...MacCentEuro エンコーディング。

Mac OSで使われる
8bit single-byteエンコーディングで、
中欧および南東欧の言語を取り扱うものです。

@see https://en.wikipedia.org/wiki/Macintosh_Central_European_encoding...

Encoding::MacCentEuro -> Encoding (17202.0)

MacCentEuro エンコーディング。

...MacCentEuro エンコーディング。

Mac OSで使われる
8bit single-byteエンコーディングで、
中欧および南東欧の言語を取り扱うものです。

@see https://en.wikipedia.org/wiki/Macintosh_Central_European_encoding...

絞り込み条件を変える

Enumerator::Lazy#enum_for(method = :each, *args) -> Enumerator::Lazy (17202.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り...

Enumerator::Lazy#enum_for(method = :each, *args) {|*args| block} -> Enumerator::Lazy (17202.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り...

Enumerator::Lazy#to_enum(method = :each, *args) -> Enumerator::Lazy (17202.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り...

Enumerator::Lazy#to_enum(method = :each, *args) {|*args| block} -> Enumerator::Lazy (17202.0)

Object#to_enum と同じですが、Enumerator::Lazy を返します。

...Object#to_enum と同じですが、Enumerator::Lazy を返します。

to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
E
numerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が...
...o_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。

//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) #=> [1,1,2,2,3,3]
def repeat(n)
raise ArgumentError if n < 0
if block_given...
...n.times { yield *val }
e
nd
e
lse
to_enum(:repeat, n)
e
nd
e
nd
e
nd

r = 1..10
p r.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

r = 1..Float::INFINITY
p r.lazy.map{|n| n**2}.repeat(2).first(5)
#=> [1, 1, 4, 4, 9]

# Lazy#to_enum のおかげで、repeat の返り...

Errno::EXXX::Errno -> Integer (17202.0)

Errno::EXXX の各クラスに対応するシステム依存のエラーコード値(整数)です。

...
E
rrno::EXXX の各クラスに対応するシステム依存のエラーコード値(整数)です。

例:

p Errno::EAGAIN::Errno # => 11
p Errno::EWOULDBLOCK::Errno # => 11...

絞り込み条件を変える

<< < 1 2 3 4 5 ... > >>