るりまサーチ (Ruby 2.5.0)

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

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

OpenSSL::X509::Name#to_a -> [[String, String, Integer]] (54628.0)

内容を配列にして返します。

内容を配列にして返します。

配列の各要素は、[属性型文字列、属性値文字列、属性値の型を表す整数(OpenSSL::ASN1以下の各定数で定義されているASN1の型)] という3要素の配列です。

例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN=foobar/emailAddress=foobar@lab3.example.co.jp')
n.to_a
# => [["C", "JP", 19], ["ST...

MatchData#length -> Integer (358.0)

部分文字列の数を返します(self.to_a.size と同じです)。

部分文字列の数を返します(self.to_a.size と同じです)。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.size # => 4
//}

MatchData#size -> Integer (358.0)

部分文字列の数を返します(self.to_a.size と同じです)。

部分文字列の数を返します(self.to_a.size と同じです)。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.size # => 4
//}

String#bytes -> [Integer] (355.0)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}

ブロックが指定された場合は String#each_byte と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#each_byte

String#codepoints -> [Integer] (355.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}

ブロックが指定された場合は String#each_codepoint と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#e...

絞り込み条件を変える

CSV::FieldInfo#line -> Integer (325.0)

行番号を返します。

行番号を返します。

//emlist[例][ruby]{
require 'csv'

csv = CSV.new("date1,date2,date3\n2018-07-09,2018-07-10\n2018-08-09,2018-08-10", headers: true)
csv.convert do |field,field_info|
p field_info.line
Date.parse(field)
end
p csv.to_a

# => 2
# => 2
# => 3
# => 3
# => [#<CSV::Row "date1":#<Date: 2018-07...

Enumerator#size -> Integer | Float::INFINITY | nil (325.0)

self の要素数を返します。

self の要素数を返します。

要素数が無限の場合は Float::INFINITY を返します。
Enumerator.new に Proc オブジェクトを指定していた場合はその
実行結果を返します。呼び出した時に要素数が不明であった場合は nil を返し
ます。

//emlist[例][ruby]{
(1..100).to_a.permutation(4).size # => 94109400
loop.size # => Float::INFINITY
(1..100).drop_while.size # => nil
//}

@see Enumerator.new

String#bytes {|byte| ... } -> self (55.0)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)

//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}

ブロックが指定された場合は String#each_byte と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#each_byte

String#codepoints {|codepoint| block } -> self (55.0)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

文字列の各コードポイントの配列を返します。(self.each_codepoint.to_a と同じです)

//emlist[例][ruby]{
#coding:UTF-8
"hello わーるど".codepoints
# => [104, 101, 108, 108, 111, 32, 12431, 12540, 12427, 12393]
//}

ブロックが指定された場合は String#each_codepoint と同じように動作します。

Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。

@see String#e...