るりまサーチ

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

別のキーワード

  1. openssl t61string
  2. asn1 t61string
  3. matrix t
  4. t61string new
  5. fiddle type_size_t

検索結果

<< 1 2 3 ... > >>

Date#>>(n) -> Date (21255.0)

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

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


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

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

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

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

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

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

@param n 月数...

Process::Status#>>(num) -> Integer (21222.0)

self.to_i >> num と同じです。

...self.to_i >> num と同じです。

@param num 整数を指定します。

fork { exit 99 } #=> 26563
Process.wait #=> 26563
$?.to_i #=> 25344
$? >> 8 #=> 99...

Integer#>>(bits) -> Integer (21212.0)

シフト演算子。bits だけビットを右にシフトします。

...。bits だけビットを右にシフトします。

右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。

@param bits シフトさせるビット数

//emlist[][ruby]{
printf("%#b\n...
...", 0b0101 >> 1) # => 0b10
p -1 >> 1 # => -1
//}...

Shell::Filter#>>(to) -> self (21212.0)

toをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば それをそのまま出力とする。

...
t
oをフィルタに追加する。 toが, 文字列ならばファイルに, IOオブジェクトであれば
それをそのまま出力とする。

@param to 出力先を指定します。文字列ならばファイルに、IOオブジェクトならばそれに出力します。

使用例
r...
...equire 'shell'
Shell.def_system_command("tail")
sh = Shell.new
sh.transact {
(sh.tail("-n 3") < "/etc/passwd") >> "tail.out"
#(sh.tail("-n 3") < "/etc/passwd") >> File.open("tail.out", "w") # でも同じ。
}...

Method#>>(callable) -> Proc (21118.0)

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

...ます。

Method#<< とは呼び出しの順序が逆になります。

@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。

//emlist[例][ruby]{
def f(x)
x * x
end

def g(x)
x + x
end

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

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

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

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

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

絞り込み条件を変える

Bignum#>>(bits) -> Fixnum | Bignum (18212.0)

シフト演算子。bits だけビットを右にシフトします。

...bits だけビットを右にシフトします。

右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。

@param bits シフトさせるビット数

printf("%#b\n", 0b0101 >> 1) #...
...=> 0b10
p -1 >> 1 #=> -1...

Fixnum#>>(bits) -> Fixnum | Bignum (18212.0)

シフト演算子。bits だけビットを右にシフトします。

...bits だけビットを右にシフトします。

右シフトは、符号ビット(最上位ビット(MSB))が保持されます。
bitsが実数の場合、小数点以下を切り捨てた値でシフトします。

@param bits シフトさせるビット数

printf("%#b\n", 0b0101 >> 1) #...
...=> 0b10
p -1 >> 1 #=> -1...

OpenSSL::BN#>>(other) -> OpenSSL::BN (18206.0)

自身を other ビット右シフトした値を返します。

...自身を other ビット右シフトした値を返します。

//emlist[][ruby]{
require 'openssl'

bn = 2.to_bn
bn >> 1 # => #<OpenSSL::BN 1>
bn # => #<OpenSSL::BN 2>
//}

@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#rshift!...

Shell::Filter#tee(file) -> Shell::Filter (9206.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...lter オブジェクトを返します.

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat...
...(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...

IRB::ExtendCommand::Help#execute(*names) -> nil (9106.0)

RI から Ruby のドキュメントを参照します。

...RI から Ruby のドキュメントを参照します。

irb(main):001:0> help String#match
...

@param names 参照したいクラス名やメソッド名などを文字列で指定します。

names を指定しなかった場合は、RI を対話的なモードで起動します。メソ...
...Enter the method name you want to look up.
You can use tab to autocomplete.
Enter a blank line to exit.

>>
String#match
String#match

(from ruby core)
------------------------------------------------------------------------------
str.match(pattern) -> matchdata or nil
str...
....match(pattern, pos) -> matchdata or nil
......

絞り込み条件を変える

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (6206.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...le#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.take(5).forc...
...e
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...

Shell#tee(file) -> Shell::Filter (6206.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...lter オブジェクトを返します.

@param file シェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat...
...(file).each { |l|
echo(l) | tee(file + ".tee") >> "all.tee"
}
}
}...
<< 1 2 3 ... > >>