るりまサーチ

最速Rubyリファレンスマニュアル検索!
390件ヒット [201-300件を表示] (0.115秒)

別のキーワード

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

検索結果

<< < 1 2 3 4 > >>

Net::POPMail#pop -> String (110.0)

メールを受信します。

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

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

@param io メールの内容を書きこむオブジェクト
@raise TimeoutError 通信がタイムアウトした...

URI::MailTo#to_mailtext -> String (109.0)

URI オブジェクトからメールテキスト文字列を生成します。

...スト文字列を生成します。

例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print
mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org...

URI::MailTo#to_rfc822text -> String (109.0)

URI オブジェクトからメールテキスト文字列を生成します。

...スト文字列を生成します。

例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print
mailto.to_mailtext

=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org...

IRB::Context#return_format -> String (108.0)

irb のプロンプトでの評価結果を表示する際のフォーマットを文字列で返します。

...irb のプロンプトでの評価結果を表示する際のフォーマットを文字列で返します。

@see IRB::Context#return_format=, print_format...

JSON::Parser#source -> String (108.0)

現在のソースのコピーを返します。

...現在のソースのコピーを返します。

//emlist[例][ruby]{
require 'json'

parser = JSON::Parser.new(DATA.read)
print
parser.source

# => {
# => "Tanaka": {
# => "name":"tanaka",
# => "age":20
# => },
# => "Suzuki": {
# => "name":"suzuki",
# => "age":25
# => }
#...

絞り込み条件を変える

WEBrick::HTTPResponse#to_s -> String (108.0)

実際にクライアントに送られるデータを文字列として返します。

...文字列として返します。

require 'webrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
res.body = 'hoge'
print
res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 08:58:49 GMT
Server:
Content-Length: 4...

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

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

...Symbol または String で指定します。

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

@see Module#public_instance_method, Object#method

//emlist[例][ruby]{
class Interpreter
def do_a() print "there, "; end
def do_d() print "Hello "; end...
...f do_e() print "!\n"; end
def do_v() print "Dave"; end
Dispatcher = {
"a" => 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).c...

Socket#connect(server_sockaddr) -> 0 (13.0)

connect(2) でソケットを接続します。

...connect(2) でソケットを接続します。

server_sockaddr は、
lib:socket#pack_string
もしくは Addrinfo オブジェクト
です。

0 を返します。

@param server_sockaddr 接続先アドレス
@raise Errno::EXXX connect(2) がエラーを報告した場合に発生します。...
...connect で www.ruby-lang.org:80 に接続するには以下のようにします。

例:

require 'socket'

s = Socket.new(Socket::AF_INET, Socket::SOCK_STREAM, 0)
sockaddr = Socket.sockaddr_in(80, "www.ruby-lang.org")
s.connect(sockaddr)
s.write "GET / HTTP/1.0\r\n\r\n"
print
s.read...

WEBrick::HTTPResponse#content_length -> Integer | nil (13.0)

Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

...Content-Length ヘッダの値を整数で表すアクセサです。デフォルトは nil です。

: body が String オブジェクトである場合
content_length の値が nil のとき Content-Length ヘッダには
body のサイズが使われます。nil でないとき body の実...
...ebrick'
include WEBrick
res = HTTPResponse.new( { :HTTPVersion => "1.1" } )
f = File.new('testfile')
res.body = f
res.content_length = 2
print
res.to_s

#=> 出力結果
HTTP/1.1 200 OK
Connection: Keep-Alive
Date: Sat, 27 Oct 2007 12:04:32 GMT
Server:
Content-Length: 2...
<< < 1 2 3 4 > >>