るりまサーチ

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

別のキーワード

  1. bigdecimal/util to_d
  2. float to_d
  3. rsa d
  4. rsa d=
  5. matrix d

ライブラリ

クラス

キーワード

検索結果

<< < ... 210 211 212 >>

Enumerable#none? {|obj| ... } -> bool (13.0)

ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。

...rue を返します。

@param pattern ブロックの代わりに各要素に対して pattern === item を評価します。

//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => fals...
...e
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none? # => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true]....

Enumerable#none?(pattern) -> bool (13.0)

ブロックを指定しない場合は、 Enumerable オブジェクトのすべての 要素が偽であれば真を返します。そうでなければ偽を返します。

...rue を返します。

@param pattern ブロックの代わりに各要素に対して pattern === item を評価します。

//emlist[例][ruby]{
require 'set'
Set['ant', 'bear', 'cat'].none? {|word| word.length == 5} # => true
Set['ant', 'bear', 'cat'].none? {|word| word.length >= 4} # => fals...
...e
Set['ant', 'bear', 'cat'].none?(/d/) # => true
Set[].none? # => true
Set[nil].none? # => true
Set[nil,false].none? # => true
Set[nil, false, true]....

Rake::TaskManager#create_rule(*args) { ... } (13.0)

与えられたパラメータに従ってルールを作成します。

...

@param args ルールに与えるパラメータを指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
rule = Rake.application.create_rule '.txt' => '.md' do |t|
"#{t}"
end
p rule # => 0x0000558dd2e32d20 /path/...
...to/Rakefile:5>
end
//}...

Range#===(obj) -> bool (13.0)

obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。

...@param obj 比較対象のオブジェクトを指定します。

//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true

p (1 .. 3).include?(1.5) # => true
//}

@see d:s...

Range#member?(obj) -> bool (13.0)

obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。

...@param obj 比較対象のオブジェクトを指定します。

//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true

p (1 .. 3).include?(1.5) # => true
//}

@see d:s...

絞り込み条件を変える

Range#overlap?(range) -> bool (13.0)

self と range に重なりがある場合は true を、そうでない場合は false を返します。

...self と range に重なりがある場合は true を、そうでない場合は false を返します。

@param range self と重なりがあるかどうかを調べたい Range オブジェクトを指定します。

@raise TypeError 引数に Range でないオブジェクトを指定した...
...[比較可能でない例][ruby]{
(1..3).overlap?('a'..'d') #=> false
//}

self または range が空である場合、false を返します。

ここで、Range が空であるとは、

* 始端が終端より大きい
* Range#exclude_end? が true であり、始端と終端が等しい

...

Rational#to_json(*args) -> String (13.0)

自身を JSON 形式の文字列に変換して返します。

...JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。

@param args 使用しません。

//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
//}

@see JSON::Generator::GeneratorMethods::Hash#to_json...
...torMethods::Hash#to_json を呼び出しています。

@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。

//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
/...
.../}

@see JSON::Generator::GeneratorMethods::Hash#to_json...

String#casecmp(other) -> -1 | 0 | 1 | nil (13.0)

String#<=> と同様に文字列の順序を比較しますが、 アルファベットの大文字小文字の違いを無視します。

...込み変数 $= には影響されません。


@param other self と比較する文字列

//emlist[例][ruby]{
"aBcDeF".casecmp("abcde") #=> 1
"aBcDeF".casecmp("abcdef") #=> 0
"aBcDeF".casecmp("abcdefg") #=> -1
"abcdef".casecmp("ABCDEF") #=> 0
//}

nil は文字列のエンコー...
...ディングが非互換の時に返されます。

//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp("\u{c4 d6 dc}") #=> nil
//}

@see String#<=>, Encoding.compatible?...
...無視するのは
Unicode 全体ではなく、A-Z/a-z だけです。

@param other self と比較する文字列

//emlist[例][ruby]{
"aBcDeF".casecmp("abcde") #=> 1
"aBcDeF".casecmp("abcdef") #=> 0
"aBcDeF".casecmp("abcdefg") #=> -1
"abcdef".casecmp("ABCDEF") #=> 0
//}

nil は...
...文字列のエンコーディングが非互換の時に返されます。

//emlist[][ruby]{
"\u{e4 f6 fc}".encode("ISO-8859-1").casecmp("\u{c4 d6 dc}") #=> nil
//}

@see String#<=>, Encoding.compatible?...

String#start_with?(*prefixes) -> bool (13.0)

self の先頭が prefixes のいずれかであるとき true を返します。

...self の先頭が prefixes のいずれかであるとき true を返します。

@param prefixes パターンを表す文字列または正規表現 (のリスト)

//emlist[例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_w...
...ith?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}

@see String#end_with?
@see String#delete_prefix, String#delete_prefix!...

URI::Generic#coerce(oth) -> [URI, URI] (13.0)

引数 oth をパースして [パース後の oth, self] の配列を返します。

...配列を返します。

@param oth URI オブジェクトか文字列を指定します。

例:

require 'uri'

uri = URI.parse("http://my.example.com")
uri.coerce("http://foo.com")
# => [#<URI::HTTP:0x00000000bcb028 URL:http://foo.com/>, #<URI::HTTP:0x00000000d92178 URL:http://my.example...

絞り込み条件を変える

Array#concat(other) -> self (12.0)

配列 other を自身の末尾に破壊的に連結します。

...配列 other を自身の末尾に破壊的に連結します。

@param other 自身と連結したい配列を指定します。

//emlist[例][ruby]{
array = [1, 2]
a = [3, 4]
array.concat a
p array # => [1, 2, 3, 4]
p a # => [3, 4] # こちらは変わらない
/...
<< < ... 210 211 212 >>