るりまサーチ

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

別のキーワード

  1. _builtin >>
  2. date >>
  3. ipaddr >>
  4. bn >>
  5. status >>

ライブラリ

モジュール

検索結果

<< 1 2 3 ... > >>

Date#>>(n) -> Date (18155.0)

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

...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(2001,1,28) >> 1 #=> #<Date: 20...
...(2001,1,31) >> 1 #=> #<Date: 2001-02-28 ...>
//}

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

//emlist[][ruby]{
require 'date'
Date.new(2001,1,31) >> 2 #=> #<Date: 2001-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 (18122.0)

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

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

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

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

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

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

...d(:f) >> method(:g)).call(3) # => 18
//}

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

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

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

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

Proc#>>(callable) -> Proc (18118.0)

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

...(f >> g).call(3) # => 18
//}

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

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

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

@see Method#<<, Method#>>...

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

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

...フトします。

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

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

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

絞り込み条件を変える

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

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

...フトします。

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

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

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

Integer#>>(bits) -> Integer (18112.0)

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

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

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

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

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

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

...IOオブジェクトならばそれに出力します。

使用例
require '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") # でも同じ。
}...

OpenSSL::BN#>>(other) -> OpenSSL::BN (18106.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!...

IPAddr#>>(num) -> IPAddr (18100.0)

ビットごとの右シフト演算により、新しい IPAddr オブジェクトを生成します。

ビットごとの右シフト演算により、新しい IPAddr オブジェクトを生成します。

@param num 右シフトする桁数。

絞り込み条件を変える

rexml/parsers/sax2parser (372.0)

SAX2 と同等の API を持つストリーム式の XML パーサ。

...arse
# >> [:start_document]
# >> [:xmldecl, "1.0", "UTF-8", nil]
# >> [:progress, 39]
# >> [:characters, "\n"]
# >> [:progress, 91]
# >> [:processing_instruction, "xml-stylesheet", " type=\"text/css\" href=\"style.css\""]
# >> [:progress, 91]
# >> [:characters, "\n"]
# >> [:progress, 144]
# >> [:doc...
...type, "root", "SYSTEM", "foo", nil]
# >> [:progress, 144]
# >> [:elementdecl, "<!ELEMENT root (a+)"]
# >> [:progress, 144]
# >> [:elementdecl, "<!ELEMENT a"]
# >> [:progress, 159]
# >> [:entitydecl, "bar", "barbarbarbar"]
# >> [:progress, 190]
# >> [:attlistdecl, "a", {"att"=>nil, "xyz"=>"foobar"},...
...bar\">"]
# >> [:progress, 245]
# >> [:notationdecl, "foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> [:progress, 683]
# >> [:entitydecl, "HTMLsymbol", "PUBLIC", "-//W3C//ENTITIES Symbols for XHTML//EN", "xhtml-symbol.ent", "%"]
# >> [:progress, 683]
# >> [:progress, 683]
# >> [:progres...

rexml/parsers/pullparser (144.0)

プル方式の XML パーサ。

...arser.pull
end
# >> xmldecl: ["1.0", "UTF-8", nil]
# >> text: ["\n", "\n"]
# >> processing_instruction: ["xml-stylesheet", " type=\"text/css\" href=\"style.css\""]
# >> text: ["\n", "\n"]
# >> start_doctype: ["root", "SYSTEM", "foo", nil]
# >> elementdecl: ["<!ELEMENT root (a+)"]
# >> elementdecl: [...
..."<!ELEMENT a"]
# >> entitydecl: ["bar", "barbarbarbar"]
# >> attlistdecl: ["a", {"att"=>nil, "xyz"=>"foobar"}, " \n <!ATTLIST a att CDATA #REQUIRED xyz CDATA \"foobar\">"]
# >> notationdecl: ["foobar", "SYSTEM", nil, "http://example.org/foobar.dtd"]
# >> entitydecl: ["HTMLsymbol", "PUBLIC", "-//W3C...
...html-symbol.ent", "%"]
# >> externalentity: ["%HTMLsymbol;"]
# >> end_doctype: []
# >> text: ["\n", "\n"]
# >> start_element: ["root", {"xmlns:foo"=>"http://example.org/foo", "xmlns:bar"=>"http://example.org/bar"}]
# >> cdata: ["cdata is here"]
# >> text: ["\n ", "\n "]
# >> start_element: ["a", {...
<< 1 2 3 ... > >>