るりまサーチ

最速Rubyリファレンスマニュアル検索!
756件ヒット [601-700件を表示] (0.093秒)

別のキーワード

  1. string []=
  2. string slice
  3. string []
  4. string slice!
  5. string gsub

ライブラリ

キーワード

検索結果

<< < ... 5 6 7 8 > >>

WIN32OLE_VARIABLE#ole_type_detail -> [String] (108.0)

変数の型と属性を取得します。

...eturn 変数の型と属性を文字列配列で返します。

tobj = WIN32OLE_TYPE.new('Microsoft XML, v5.0', 'tagSTATSTG')
tobj.variables.each do |v|
puts "#{v.ole_type} [#{v.ole_type_detail.join(', ')}] #{v.name}"
end

出力結果

Unknown Type 31 [] pwcsName # => VT_LPWSTR...

Enumerator#with_object(obj) -> Enumerator (37.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 (37.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...

Module#instance_method(name) -> UnboundMethod (25.0)

self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

...ンスタンスメソッド name をオブジェクト化した UnboundMethod を返します。

@param name メソッド名を Symbol または String で指定します。

@raise NameError self に存在しないメソッドを指定した場合に発生します。

@see Module#public_instance_...
...method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string
.each_char {|b| Dispatcher[b].bind(self).call }
end
end

interpreter = Interpreter.new
interpreter.interpret('dave')
# => Hello there, Dave!...

Range#%(s) -> Enumerator (25.0)

範囲内の要素を s おきに繰り返します。

...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)

//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10

("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"...
...きます)

//emlist[数値以外の Range に対する例][ruby]{
# Time の Range は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)

# step は使用可能
(Time.utc(2024, 12, 25)...Ti...

絞り込み条件を変える

Range#%(s) -> Enumerator::ArithmeticSequence (25.0)

範囲内の要素を s おきに繰り返します。

...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)

//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10

("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"...
...きます)

//emlist[数値以外の Range に対する例][ruby]{
# Time の Range は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)

# step は使用可能
(Time.utc(2024, 12, 25)...Ti...

Range#step(s = 1) -> Enumerator (25.0)

範囲内の要素を s おきに繰り返します。

...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)

//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10

("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"...
...きます)

//emlist[数値以外の Range に対する例][ruby]{
# Time の Range は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)

# step は使用可能
(Time.utc(2024, 12, 25)...Ti...

Range#step(s = 1) -> Enumerator::ArithmeticSequence (25.0)

範囲内の要素を s おきに繰り返します。

...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)

//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10

("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"...
...きます)

//emlist[数値以外の Range に対する例][ruby]{
# Time の Range は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)

# step は使用可能
(Time.utc(2024, 12, 25)...Ti...

Range#step(s = 1) {|item| ... } -> self (25.0)

範囲内の要素を s おきに繰り返します。

...::ArithmeticSequence を返します。
@return ブロックを指定しなかったその他の Range の時は Enumerator を返します。(例: String の Range)

//emlist[例][ruby]{
(1..10).step(3) {|v| p v}
# => 1
# 4
# 7
# 10

("a".."f").step(2) {|v| p v}
# => "a"
# "c"
# "e"...
...きます)

//emlist[数値以外の Range に対する例][ruby]{
# Time の Range は each でイテレートできない
(Time.utc(2024, 12, 25)...Time.utc(2024, 12, 26)).each { |t| p t }
# => 'Range#each': can't iterate from Time (TypeError)

# step は使用可能
(Time.utc(2024, 12, 25)...Ti...

Net::SMTP#send_mail(mailsrc, from_addr, *to_addrs) -> () (19.0)

メールを送信します。

...メールを送信します。

mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に...
...ールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}

sendmail は obsolete です。

@param m...

絞り込み条件を変える

Net::SMTP#send_message(mailsrc, from_addr, *to_addrs) -> () (19.0)

メールを送信します。

...メールを送信します。

mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に...
...ールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}

sendmail は obsolete です。

@param m...

Net::SMTP#sendmail(mailsrc, from_addr, *to_addrs) -> () (19.0)

メールを送信します。

...メールを送信します。

mailsrc をメールとして送信します。
mailsrc は each イテレータを持つ
オブジェクトならなんでも構いません(たとえば String や File)。

from_domain は送り主のメールアドレス ('...@...'のかたち) 、
to_addrs に...
...ールアドレスを文字列で渡します。

require 'net/smtp'

Net::SMTP.start('smtp.example.com') {|smtp|
smtp.send_message mail_string,
'from@example.com',
'to1@example.net', 'to2@example.net'
}

sendmail は obsolete です。

@param m...

Net::POPMail#all {|str| .... } -> nil (16.0)

メールを受信します。

...,
'YourAccount', 'YourPassword') {|pop|
pop.mails.each do |m|
puts m.pop
end
}


ブロックを利用する例:
require 'net/pop'

Net::POP3.start('pop.example.com', 110) {|pop|
pop.each_mail do |m|
m.pop do |str|
print str
end
end...

Net::POPMail#all(io) -> object (16.0)

メールを受信します。

...,
'YourAccount', 'YourPassword') {|pop|
pop.mails.each do |m|
puts m.pop
end
}


ブロックを利用する例:
require 'net/pop'

Net::POP3.start('pop.example.com', 110) {|pop|
pop.each_mail do |m|
m.pop do |str|
print str
end
end...
<< < ... 5 6 7 8 > >>