るりまサーチ

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

別のキーワード

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

検索結果

<< < ... 3 4 5 >>

OpenURI::OpenRead#read(options = {}) -> String (108.0)

自身が表す内容を読み込んで文字列として返します。 self.open(options={}) {|io| io.read } と同じです。 このメソッドによって返される文字列は OpenURI::Meta によって extend されています。

...のメソッドによって返される文字列は OpenURI::Meta
によって extend されています。

@param options ハッシュを与えます。

require 'open-uri'
uri = URI.parse('http://www.example.com/')
str = uri.read
p str.is_a?(OpenURI::Meta) # => true
p str.content_type...

REXML::Instruction#target -> String (108.0)

XML 処理命令のターゲットを返します。

...quire 'rexml/document'
doc = REXML::Document.new(<<EOS)
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/css" href="style.css"?>
<root />
EOS
doc[2] # => <?p-i xml-stylesheet ...?>
doc[2].target # => "xml-stylesheet"
doc[2].content # => "type=\"text/css\" href=\"style.css\""
//}...

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

hoge...

WEBrick::HTTPUtils::FormData#[](header) -> String | nil (108.0)

自身が multipart/form-data なデータの場合に、header で指定された ヘッダの値を文字列で返します。無ければ nil を返します。

...nil を返します。

@param header ヘッダ名を文字列で指定します。大文字と小文字を区別しません。

例:

require "webrick/cgi"
class MyCGI < WEBrick::CGI
def do_GET(req, res)
p req.query['q']['content-type'] #=> "plain/text"
end
end
MyCGI.new.start()...

CGI#print(*strings) (107.0)

@todo

...@todo

引数の文字列を標準出力に出力します。
cgi.print は $DEFAULT_OUTPUT.print と等価です。

例:
cgi = CGI.new
cgi.print "This line is a part of content body.\r\n"...

絞り込み条件を変える

CGI#out(options = "text/html") { .... } (61.0)

HTTP ヘッダと、ブロックで与えられた文字列を標準出力に出力します。

...CGI.new
cgi.out{ "string" }
# Content-Type: text/html
# Content-Length: 6
#
# string

cgi.out("text/plain"){ "string" }
# Content-Type: text/plain
# Content-Length: 6
#
# string

cgi.out({"nph"...
...# Content-Type: text/html; charset=iso-2022-jp
"language" => "ja",
"expires" => Time.now + (3600 * 24 * 30),
"cookie" => [cookie1, cookie2],
"my_header1" => "my_value",
"my_header2" => "my_value"}){ "string...

WEBrick::HTTPRequest#query -> Hash (19.0)

リクエストのクエリーあるいはクライアントがフォームへ入力した値を表すハッシュを返します。

...multipart/form-data なフォームデータの場合には
ユーザが content-transfer-encoding ヘッダを見て適切に処理する必要があります。

ハッシュの値は正確には文字列ではなく String クラスのサブクラスである WEBrick::HTTPUtils::FormData
クラ...
...巨大な文字列が
生成されてしまいます。

例:

h = req.query
p h['q'] #=> "ruby rails session"
p h['upfile']['content-type'] #=> "plain/text"
p h['upfile'].filename #=> "my_file.txt"
p h['upfile'] #=> "hoge hoge hoge"...
<< < ... 3 4 5 >>