900件ヒット
[1-100件を表示]
(0.075秒)
別のキーワード
クラス
- Array (93)
- BasicObject (24)
- CSV (24)
-
CSV
:: Row (12) -
CSV
:: Table (48) -
Digest
:: Base (60) - Enumerator (96)
-
Enumerator
:: Yielder (12) - FrozenError (6)
- Integer (30)
- Method (19)
- Module (12)
-
Net
:: HTTP (36) -
Net
:: HTTPResponse (24) - Object (96)
-
OpenSSL
:: BN (12) - Proc (7)
-
REXML
:: Elements (24) - Regexp (24)
- String (193)
モジュール
- Enumerable (48)
キーワード
- == (24)
- [] (18)
- add (12)
-
append
_ as _ bytes (1) - clone (12)
- combination (24)
-
define
_ singleton _ method (24) - digest (12)
- digest! (12)
- dup (12)
- each (48)
-
each
_ with _ object (24) - empty? (12)
- extend (12)
-
force
_ quotes? (12) - get (12)
- gsub (48)
- gsub! (48)
- hexdigest (12)
- hexdigest! (12)
-
initialize
_ copy (12) - inspect (6)
- match (24)
- methods (12)
- pack (21)
- permutation (12)
- post (12)
-
prepend
_ features (12) - push (12)
-
read
_ body (24) - receiver (6)
-
repeated
_ combination (24) -
set
_ debug _ output (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
sort
_ by (24) - sub (36)
- sub! (36)
- sum (12)
-
to
_ s (18) - unpack (12)
-
with
_ index (24) -
with
_ object (24) -
write
_ headers? (12)
検索結果
先頭5件
-
OpenSSL
:: BN # <<(other) -> OpenSSL :: BN (21319.0) -
自身を other ビット左シフトした値を返します。
...自身を other ビット左シフトした値を返します。
//emlist[][ruby]{
bn = 1.to_bn
pp bn << 1 # => #<OpenSSL::BN 2>
pp bn # => #<OpenSSL::BN 1>
//}
@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#lshift!... -
CSV
:: Table # <<(row _ or _ array) -> self (21219.0) -
自身の最後に新しい行を追加します。
...ために自身を返します。
//emlist[例][ruby]{
require "csv"
row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
table = CSV::Table.new([row1])
table << row2
table.to_a # => [["header1", "header2"], ["row1_1",... -
Method
# <<(callable) -> Proc (18367.0) -
self と引数を合成した Proc を返します。
...lable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します。
Method#>> とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{......thod(: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.me......thod(:read)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Integer
# <<(bits) -> Integer (18355.0) -
シフト演算子。bits だけビットを左にシフトします。
...シフト演算子。bits だけビットを左にシフトします。
@param bits シフトさせるビット数
//emlist[][ruby]{
printf("%#b\n", 0b0101 << 1) # => 0b1010
p -1 << 1 # => -2
//}... -
Proc
# <<(callable) -> Proc (18355.0) -
self と引数を合成した Proc を返します。
...llable に渡して呼び出し、
その戻り値を self に渡して呼び出した結果を返します。
Proc#>> とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{......(f << 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 = proc { |data| puts "word count: #{data.size}" } << W......ordScanner << File.method(:read)
pipeline.call('testfile') # => word count: 4
//}
@see Method#<<, Method#>>... -
Array
# <<(obj) -> self (18349.0) -
指定された obj を自身の末尾に破壊的に追加します。
...れた obj を自身の末尾に破壊的に追加します。
//emlist[例][ruby]{
ary = [1]
ary << 2
p ary # [1, 2]
//}
またこのメソッドは self を返すので、以下のように連続して
書くことができます。
//emlist[例][ruby]{
ary = [1]
ary << 2 << 3 << 4
p ary......#=> [1, 2, 3, 4]
//}
@param obj 自身に加えたいオブジェクトを指定します。Array#push と違って引数は一つしか指定できません。
@see Array#push... -
Enumerator
:: Yielder # <<(object) -> () (18343.0) -
Enumerator.new で使うメソッドです。
...ブロックが実行され、
ブロック内の << が呼ばれるたびに each に渡されたブロックが
<< に渡された値とともに繰り返されます。
//emlist[例][ruby]{
enum = Enumerator.new do |y|
y << 1
y << 2
y << 3
end
enum.each do |v|
p v
end
# => 1
# 2
#... -
REXML
:: Elements # <<(element = nil) -> REXML :: Element (18237.0) -
要素 element を追加します。
...す。
追加された要素が返されます。
@param element 追加する要素
//emlist[][ruby]{
require 'rexml/document'
a = REXML::Element.new('a')
a.elements.add(REXML::Element.new('b')) # => <b/>
a.to_s # => "<a><b/></a>"
a.elements.add('c') # => <c/>
a.to_s # => "<a><b/><c/></a>"
//}... -
Enumerable
# each _ with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6519.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
...返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6519.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...の各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
obj には任意のオブジェクトを渡すことができます。
ブロックが渡されなかった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumer......例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# => foo:1
# => foo:2
//}
@param obj 繰......り返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object...