別のキーワード
ライブラリ
- ビルトイン (759)
- base64 (22)
- csv (22)
- drb (22)
- erb (14)
-
irb
/ inspector (11) - matrix (77)
-
minitest
/ spec (3) - mkmf (77)
- pathname (33)
- prime (66)
- psych (45)
- rake (22)
-
rexml
/ document (33) -
rubygems
/ dependency _ installer (11) -
rubygems
/ source _ info _ cache (22) - shellwords (11)
- socket (462)
- syslog (11)
- win32ole (22)
クラス
- CSV (11)
-
DRb
:: DRbObject (22) - Data (2)
- ERB (14)
- Enumerator (44)
-
Enumerator
:: Lazy (10) -
Gem
:: DependencyInstaller (11) -
Gem
:: SourceInfoCache (22) - Hash (122)
- IO (154)
-
IRB
:: Inspector (11) - Matrix (66)
- Method (73)
- Module (17)
- Object (13)
- Pathname (33)
-
Prime
:: PseudoPrimeGenerator (66) - Proc (5)
-
REXML
:: Child (11) -
REXML
:: Element (22) -
Rake
:: TaskArguments (11) - Refinement (3)
- Socket (231)
- String (76)
- Symbol (10)
- Thread (24)
- Time (11)
- Vector (11)
-
WIN32OLE
_ EVENT (22)
モジュール
- Base64 (22)
- Enumerable (119)
- Kernel (134)
- Marshal (22)
- Psych (34)
-
Rake
:: TaskManager (11) - Shellwords (11)
-
Socket
:: Constants (231) - Syslog (11)
キーワード
- < (11)
- === (7)
-
AI
_ PASSIVE (22) - CSV (11)
-
EAI
_ NODATA (22) -
IPV6
_ PKTINFO (22) -
IPV6
_ RECVHOPLIMIT (22) -
IPV6
_ RECVPATHMTU (22) -
IP
_ BLOCK _ SOURCE (22) -
IP
_ HDRINCL (22) -
IP
_ PASSSEC (22) -
IP
_ PKTINFO (22) -
IP
_ PKTOPTIONS (22) -
IP
_ PORTRANGE (22) -
IP
_ RECVDSTADDR (22) -
IP
_ RECVIF (22) -
IP
_ RECVOPTS (22) -
IP
_ RECVSLLA (22) -
IP
_ RECVTOS (22) -
IP
_ RECVTTL (22) -
IP
_ UNBLOCK _ SOURCE (22) - Marshal フォーマット (11)
- Method (11)
-
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 3
. 0 . 0 (4) - Rubyの起動 (11)
-
SO
_ RECVUCRED (22) -
SO
_ TIMESTAMP (22) -
SO
_ TIMESTAMPNS (22) - [] (11)
-
_ _ drbref (11) - abort (22)
-
angle
_ with (11) - build (22)
- call (22)
-
check
_ signedness (22) - children (11)
- chunk (11)
- compact (3)
-
delete
_ prefix (7) -
delete
_ prefix! (7) -
delete
_ suffix (7) -
delete
_ suffix! (7) -
dir
_ config (11) - dump (44)
- each (22)
-
each
_ child (22) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) -
each
_ with _ index (66) -
each
_ with _ object (22) -
end
_ with? (16) -
enhance
_ with _ matching _ rule (11) - exit (11)
- filter! (12)
-
find
_ gems _ with _ sources (11) -
import
_ methods (3) -
infect
_ with _ assertions (1) -
keep
_ if (22) -
keys
_ with _ inspector (11) - mask (11)
-
max
_ by (44) - mkmf (11)
-
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) - name (11)
- new (37)
-
new
_ with _ uri (11) -
on
_ event (11) -
on
_ event _ with _ outargs (11) - owner (11)
- popen (154)
- rdoc (11)
-
rdoc
/ markdown (11) - receiver (11)
-
replace
_ with (11) -
report
_ on _ exception (16) -
report
_ on _ exception= (8) - result (7)
-
result
_ with _ hash (7) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 8 . 5 feature (11) -
ruby2
_ keywords (10) -
rubygems
/ commands / generate _ index _ command (11) -
safe
_ load (12) -
search
_ with _ source (22) - select! (22)
- shelljoin (11)
-
start
_ with? (16) - strftime (11)
- system (24)
-
to
_ h (17) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) -
urlsafe
_ decode64 (11) -
urlsafe
_ encode64 (11) -
with
_ config (22) -
with
_ defaults (11) -
with
_ index (54) -
with
_ object (44) -
with
_ werror (22) - xmlrpc (3)
- yaml (11)
-
yaml
_ tag (11) - パターンマッチ (11)
- 正規表現 (11)
検索結果
先頭5件
-
Data
# with(**kwargs) -> Data (18243.0) -
self をコピーしたオブジェクトを返します。
....define(:name, :age)
dog1 = Dog.new("Fred", 5) # => #<data Dog name="Fred", age=5>
dog2 = dog1.with(age: 6) # => #<data Dog name="Fred", age=6>
p dog1 # => #<data Dog name="Fred", age=5>
dog3 = dog1.with(type: "Terrier") # => ArgumentError (unknown keyword: :type)
# メン......オブジェクトはコピーされず、同じオブジェクトを参照する。
dog1.name.upcase!
p dog1 # => #<data Dog name="FRED", age=5>
p dog2 # => #<data Dog name="FRED", age=6>
//}
[注意] 本メソッドの記述は Data のサブクラスのインスタンスに対して呼び
出す... -
REXML
:: Element # each _ element _ with _ text(text = nil , max = 0 , name = nil) {|element| . . . } -> () (6285.0) -
テキストを子ノードとして 持つすべての子要素を引数としてブロックを呼び出します。
...<a><b>b</b><c>b</c><d>d</d><e/></a>'
doc.root.each_element_with_text {|e|p e}
# >> <b> ... </>
# >> <c> ... </>
# >> <d> ... </>
doc.root.each_element_with_text('b'){|e|p e}
# >> <b> ... </>
# >> <c> ... </>
doc.root.each_element_with_text('b', 1){|e|p e}
# >> <b> ... </>
doc.root.each_element_with_......text(nil, 0, 'd'){|e|p e}
# >> <d> ... </>
//}... -
Symbol
# start _ with?(*prefixes) -> bool (6243.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...elf.to_s.start_with?と同じです。)
@param prefixes パターンを表す文字列または正規表現 (のリスト)
@see Symbol#end_with?
@see String#start_with?
//emlist[][ruby]{
:hello.start_with?("hell") #=> true
:hello.start_with?(/H/i) #=> true
# return......s true if one of the prefixes matches.
:hello.start_with?("heaven", "hell") #=> true
:hello.start_with?("heaven", "paradise") #=> false
//}... -
String
# start _ with?(*prefixes) -> bool (6237.0) -
self の先頭が prefixes のいずれかであるとき true を返します。
...例][ruby]{
"string".start_with?("str") # => true
"string".start_with?("ing") # => false
"string".start_with?("ing", "str") # => true
"string".start_with?(/\w/) # => true
"string".start_with?(/\d/) # => false
//}
@see String#end_with?
@see String#delete_prefi... -
Symbol
# end _ with?(*suffixes) -> bool (6237.0) -
self の末尾が suffixes のいずれかであるとき true を返します。
...nd_with?と同じです。)
@param suffixes パターンを表す文字列 (のリスト)
@see Symbol#start_with?
@see String#end_with?
//emlist[][ruby]{
:hello.end_with?("ello") #=> true
# returns true if one of the +suffixes+ matches.
:hello.end_with?("heaven", "ello") #=> t......rue
:hello.end_with?("heaven", "paradise") #=> false
//}... -
Enumerable
# each _ with _ index(*args) -> Enumerator (6232.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...た場合は、
要素とそのインデックスを繰り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (6232.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...た場合は、
要素とそのインデックスを繰り返すような
Enumerator を返します。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args......each_with_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerator
# with _ index(offset = 0) -> Enumerator (6226.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [120, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]
# ["baz", 3]......にインデックスを添えてブロックを繰り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。... -
Enumerator
# with _ index(offset = 0) {|(*args) , idx| . . . } -> object (6226.0) -
生成時のパラメータに従って、要素にインデックスを添えて繰り返します。 インデックスは offset から始まります。
...Enumerator.new {|y| str.each_byte {|b| y << b }}
enum.with_index {|byte, idx| p [byte, idx] }
# => [120, 0]
# [121, 1]
# [122, 2]
require "stringio"
StringIO.new("foo|bar|baz").each("|").with_index(1) {|s, i| p [s, i] }
# => ["foo|", 1]
# ["bar|", 2]
# ["baz", 3]......にインデックスを添えてブロックを繰り返します。
インデックスは 0 から始まります。
Enumerator#with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。... -
Enumerator
# with _ object(obj) -> Enumerator (6226.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...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... -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (6226.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...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... -
Kernel
# with _ config(config , default = nil) -> bool | String (6226.0) -
configure のオプションを検査します。
...configure のオプションを検査します。
configure のオプションに --with-<config> が指定された場合は真を返しま
す。--without-<config> が指定された場合は偽を返します。どちらでもない場
合は default を返します。
これはデバッグ情......定義を、追加するのに役立ちます。
@param config configure のオプションの名前を指定します。
@param default デフォルト値を返します。
例
require 'mkmf'
if with_config("debug")
$defs.push("-DOSSL_DEBUG") unless $defs.include? "-DOSSL_DEBUG"
end...