るりまサーチ

最速Rubyリファレンスマニュアル検索!
3816件ヒット [1-100件を表示] (0.025秒)
トップページ > クエリ:<[x] > クエリ:ruby[x]

別のキーワード

  1. _builtin <
  2. bigdecimal <
  3. module <
  4. float <
  5. complex <

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 ... > >>

Module#<(other) -> bool | nil (18142.0)

比較演算子。self が other の子孫である場合、 true を返します。 self が other の先祖か同一のクラス/モジュールである場合、false を返します。

...します。

//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
end
class Qux
end
p Bar < Foo # => true
p Baz < Bar # => true
p Baz < Foo # => true
p Baz < Qux # => nil
p Baz > Qux # => nil

p Foo < Object.new # => in `<': compared with non class/mod...

FileUtils#ruby(*args) {|result, status| ... } (18135.0)

与えられた引数で Ruby インタプリタを実行します。

...与えられた引数で Ruby インタプリタを実行します。

@param args Ruby インタプリタに与える引数を指定します。

例:
ruby
%{-pe '$_.upcase!' <README}

@see Kernel.#sh...

Hash#<(other) -> bool (18124.0)

self が other のサブセットである場合に真を返します。

...サブセットである場合に真を返します。

@param other 自身と比較したい Hash オブジェクトを指定します。

//emlist[例][ruby]{
h1 = {a:1, b:2}
h2 = {a:1, b:2, c:3}
h1 < h2 # => true
h2 < h1 # => false
h1 < h1 # => false
//}

@see Hash#<=, Hash#>=, Hash#>...

Comparable#<(other) -> bool (18118.0)

比較演算子 <=> をもとにオブジェクト同士を比較します。 <=> が負の整数を返した場合に、true を返します。 それ以外の整数を返した場合に、false を返します。

... <=> をもとにオブジェクト同士を比較します。
<
=> が負の整数を返した場合に、true を返します。
それ以外の整数を返した場合に、false を返します。

@param other 自身と比較したいオブジェクトを指定します。
@raise ArgumentError <...
...=> が nil を返したときに発生します。

//emlist[例][ruby]{
1 < 1 # => false
1 < 2 # => true
//}...

Integer#<(other) -> bool (18118.0)

比較演算子。数値として小さいか判定します。

...比較演算子。数値として小さいか判定します。

@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。

//emlist[][ruby]{
1 < 1 # => false
1 < 2 # => true
//}...

絞り込み条件を変える

Float#<(other) -> bool (18112.0)

比較演算子。数値として小さいか判定します。

...数値として小さいか判定します。

@param other 比較対象の数値
@return self よりも other が大きい場合 true を返します。
そうでなければ false を返します。

//emlist[例][ruby]{
3.14 < 3.1415 # => true
3.14 <= 3.1415 # => true
//}...

Method#<<(callable) -> Proc (6124.0)

self と引数を合成した Proc を返します。

...st[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

# (3 + 3) * (3 + 3)
p (method(:f) << method(:g)).call(3) # => 36
//}

//emlist[call を定義したオブジェクトを渡す例][ruby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end

File.write('testfile', <<~TEXT)...
...Hello, World!
Hello, Ruby!
TEXT

pipeline = method(:pp) << WordScanner << File.method(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}

@see Proc#<<, Proc#>>...

Psych::Visitors::YAMLTree#<<(object) (6122.0)

変換対象の Ruby オブジェクトを追加します。

...変換対象の Ruby オブジェクトを追加します。

@param object YAML AST へ変換する Ruby オブジェクト...

Date#<<(n) -> Date (6118.0)

self より n ヶ月前の日付オブジェクトを返します。 n は数値でなければなりません。

...ruby]{
require 'date'
Date.new(2001,2,3) << 1 #=> #<Date: 2001-01-03 ...>
Date.new(2001,2,3) << -2 #=> #<Date: 2001-04-03 ...>
//}

対応する月に同じ日が存在しない時は、代わりにその月の末日が使われます。

//emlist[][ruby]{
require 'date'
Date.new(2001,3,28) <...
...< 1 #=> #<Date: 2001-02-28 ...>
Date.new(2001,3,31) << 1 #=> #<Date: 2001-02-28 ...>
//}

このことは以下のように、もしかすると予期しない振る舞いをするかもしれません。

//emlist[][ruby]{
require 'date'
Date.new(2001,3,31) << 2 #=> #<Date: 2001-01-31 ....
.....>
Date.new(2001,3,31) << 1 << 1 #=> #<Date: 2001-01-28 ...>

Date.new(2001,3,31) << 1 << -1 #=> #<Date: 2001-03-28 ...>
//}

Date#prev_month も参照してください。

@param n 月数...
<< 1 2 3 ... > >>