るりまサーチ

最速Rubyリファレンスマニュアル検索!
26205件ヒット [1-100件を表示] (0.152秒)
トップページ > クエリ:-[x] > クエリ:ruby[x] > 種類:インスタンスメソッド[x]

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

クラス

キーワード

検索結果

<< 1 2 3 ... > >>

Time#-(sec) -> Time (18155.0)

自身より sec 秒だけ前の時刻を返します。

...り sec 秒だけ前の時刻を返します。

@param sec 実数を秒を単位として指定します。

//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00 +0900
p t2 - 2592000 # => 2000-01-01 00:00:00 +0900
//}...

Time#-(time) -> Float (18145.0)

自身と time との時刻の差を Float で返します。単位は秒です。

...します。単位は秒です。

@param time 自身との差を算出したい Time オブジェクトを指定します。

//emlist[][ruby]{
p t = Time.local(2000) # => 2000-01-01 00:00:00 +0900
p t2 = t + 2592000 # => 2000-01-31 00:00:00 +0900
p t2 - t # => 2592000.0
//}...

Array#-(other) -> Array (18119.0)

自身から other の要素を取り除いた配列を生成して返します。

...換を試みます。

@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 2, 1, 3, 1, 4] - [4, 2] # => [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}...
...@raise TypeError 引数に配列以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
[1, 2, 1, 3, 1, 4] - [4, 2] # => [1, 1, 3, 1]

[1, 2, 1, 3, 1, 4] - [1, 4] # => [2, 3]
//}


@see Array#difference...

Complex#-(other) -> Complex (18119.0)

差を計算します。

...差を計算します。

@param other 自身から引く数

//emlist[例][ruby]{
Complex(1, 2) - Complex(2, 3) # => (-1-1i)
//}...

Rational#-(other) -> Rational | Float (18119.0)

差を計算します。

...差を計算します。

@param other 自身から引く数

other に Float を指定した場合は、計算結果を Float で返しま
す。

//emlist[例][ruby]{
r = Rational(3, 4)
r - 1 # => (-1/4)
r - 0.5 # => 0.25
//}...

絞り込み条件を変える

Float#-(other) -> Float (18113.0)

算術演算子。差を計算します。

...算術演算子。差を計算します。

@param other 二項演算の右側の引数(対象)

//emlist[例][ruby]{
# 差
4.5 - 1.3 # => 3.2
//}...

Integer#-(other) -> Numeric (18113.0)

算術演算子。差を計算します。

...算術演算子。差を計算します。

@param other 二項演算の右側の引数(対象)
@return 計算結果

//emlist[][ruby]{
4 - 1 #=> 3
//}...

Set#-(enum) -> Set (18113.0)

差集合、すなわち、元の集合の要素のうち引数 enum に含まれる要素を取り除いた 新しい集合を作ります。

...@param enum each メソッドが定義されたオブジェクトを指定します。
@raise ArgumentError 引数 enum に each メソッドが定義されていない場合に
発生します。

//emlist[][ruby]{
require 'set'
p Set[10, 20, 30] - Set[10, 20, 40]
# => #<Set: {30}>
//}...

Module#ruby2_keywords(method_name, ...) -> nil (6232.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.

...ate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the module responds to this method befo...
...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
ruby
2_keywords(:foo) if respond_to?(:ruby2_keywords, true)
end
//}...

Proc#ruby2_keywords -> proc (6232.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.

...ate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.

This method will probably be removed at some point, as it exists only
for backwards compatibility. As it does not exist in Ruby versions
before 2.7, check that the proc responds to this method before...
...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
//}...

絞り込み条件を変える

Gem::Specification#required_ruby_version -> Gem::Requirement (6218.0)

この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。

...この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。...
<< 1 2 3 ... > >>