るりまサーチ

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

別のキーワード

  1. _builtin ord
  2. string ord
  3. integer ord
  4. ord _builtin

クラス

キーワード

検索結果

<< 1 2 > >>

Integer#ord -> Integer (18128.0)

自身を返します。

...自身を返します。

//emlist[][ruby]{
10.ord #=> 10
# String#ord
?a.ord #=> 97
//}

@see String#ord...

String#ord -> Integer (18110.0)

文字列の最初の文字の文字コードを整数で返します。

...の文字コードを整数で返します。

self が空文字列のときは例外を発生します。

@return 文字コードを表す整数
@raise ArgumentError self の長さが 0 のとき発生

//emlist[例][ruby]{
p "a".ord # => 97
//}

@see Integer#chr, String#chr...

Module#ruby2_keywords(method_name, ...) -> nil (6103.0)

For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.

...s, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword arguments, the final hash argument...
...that method call does not include explicit
keywords or a keyword splat, the final element is interpreted as
keywords. In other words, keywords will be passed through the method to
other methods.

This should only be used for methods that delegate keywords to another
method, and only for backwards co...
...aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.

//emlist[例][ruby]{
module Mod
def foo(meth, *args, &block)
send(:"do_#{meth}", *args, &block)
end
ruby2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}...

Proc#ruby2_keywords -> proc (6103.0)

Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.

...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked...
...that
method call does not include explicit keywords or a keyword splat, the
final element is interpreted as keywords. In other words, keywords will
be passed through the proc to other methods.

This should only be used for procs that delegate keywords to another
method, and only for backwards comp...
...so, be aware that if this method is removed, the behavior of the
proc will change so that it does not pass through keywords.

//emlist[][ruby]{
module Mod
foo = ->(meth, *args, &block) do
send(:"do_#{meth}", *args, &block)
end
foo.ruby2_keywords if foo.respond_to?(:ruby2_keywords)
end
//}...

Exception#full_message(highlight: true, order: :bottom) -> String (103.0)

例外の整形された文字列を返します。

...引数 highlight と order は 2.5.1 で追加されました。

@param highlight エスケープシーケンスによる文字装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。

@param order :top か :bottom...
...装飾をつけるかどうかを指定します。
デフォルト値は Exception.to_tty? の返り値と同じです。

@param order :top か :bottom で指定する必要があります。
バックトレースの一番奥がエラーメッセージの上(top)か...

絞り込み条件を変える

Array#to_h -> Hash (9.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...ruby]{
bar], [1, 2.to_h # => {:foo => :bar, 1 => 2}
//}

ブロックを指定すると配列の各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
["foo", "bar"].to_h {|s| [s.ord, s]} # => {102=>"foo", 98=>"bar"}
//}...

Array#to_h { block } -> Hash (9.0)

self を [key, value] のペアの配列として解析した結果を Hash にして 返します。

...ruby]{
bar], [1, 2.to_h # => {:foo => :bar, 1 => 2}
//}

ブロックを指定すると配列の各要素でブロックを呼び出し、
その結果をペアとして使います。

//emlist[ブロック付きの例][ruby]{
["foo", "bar"].to_h {|s| [s.ord, s]} # => {102=>"foo", 98=>"bar"}
//}...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer) -> Symbol (9.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset) -> Symbol (9.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize) -> Symbol (9.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

絞り込み条件を変える

Encoding::Converter#primitive_convert(source_buffer, destination_buffer, destination_byteoffset, destination_bytesize, options) -> Symbol (9.0)

エンコーディング変換のためのメソッドの中で、もっとも細かな扱いが可能なメソッドです。

...redo
when :undefined_conversion
c = ec.primitive_errinfo[3].dup.force_encoding(ec.primitive_errinfo[1])
ec.insert_output('\x{%X:%s}' % [c.ord, c.encoding])
redo
when :incomplete_input
ec.insert_output(ec.primitive_errinfo[3].dump[1..-2])
when :finished
end
break
end while...

Integer#chr -> String (9.0)

self を文字コードとして見た時に、引数で与えたエンコーディング encoding に対応する文字を返します。

...ンコーディングを表すオブジェクト。Encoding::UTF_8、'shift_jis' など。
@return 一文字からなる文字列
@raise RangeError self を与えられたエンコーディングで正しく解釈できない場合に発生します。
@see String#ord Encoding.default_internal...
<< 1 2 > >>