るりまサーチ

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

別のキーワード

  1. _builtin using
  2. main using
  3. module using
  4. processcontroller using_at_exit_when_process_exit
  5. shell/process-controller using_at_exit_when_process_exit

検索結果

<< < ... 3 4 5 >>

Net::HTTP#request_get(path, header = nil) -> Net::HTTPResponse (6.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...t[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end...

Net::HTTP#request_get(path, header = nil) {|response| .... } -> Net::HTTPResponse (6.0)

サーバ上の path にあるエンティティを取得します。 Net::HTTPResponse オブジェクトを返します。

...t[例][ruby]{
# example
response = http.request_get('/index.html')
p response['content-type']
puts response.body # body is already read

# using block
http.request_get('/index.html') {|response|
p response['content-type']
response.read_body do |str| # read body now
print str
end...

Net::HTTP#request_post(path, data, header = nil) -> Net::HTTPResponse (6.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

...[ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body d...

Net::HTTP#request_post(path, data, header = nil) {|response| .... } -> Net::HTTPResponse (6.0)

サーバ上の path にあるエンティティに対し文字列 data を POST で送ります。 返り値は Net::HTTPResponse のインスタンスです。

...[ruby]{
response = http.request_post('/cgi-bin/nice.rb', 'datadatadata...')
p response.status
puts response.body # body is already read

# using block
http.request_post('/cgi-bin/nice.rb', 'datadatadata...') {|response|
p response.status
p response['content-type']
response.read_body d...

Net::POP3.auth_only(address, port = nil, account, password, isapop=false) (6.0)

POP セッションを開き、認証だけを行って接続を切ります。

...に POP before SMTP のために用意されています。


使用例:

require 'net/pop'

Net::POP3.auth_only('pop.example.com', nil, # using default port (110)
'YourAccount', 'YourPassword')

@param address POP3サーバのホスト名文字列
@param port 接続す...

絞り込み条件を変える

Proc.new -> Proc (6.0)

ブロックをコンテキストとともにオブジェクト化して返します。

...ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
...

Proc.new { ... } -> Proc (6.0)

ブロックをコンテキストとともにオブジェクト化して返します。

...ブロックを指定しない場合、Ruby 2.7 では
$VERBOSE = true のときには警告メッセージ
「warning: Capturing the given block using Proc.new is deprecated; use `&block` instead」
が出力され、Ruby 3.0 では
ArgumentError (tried to create Proc object without a block)
...

Refinement#import_methods(*modules) -> self (6.0)

モジュールからメソッドをインポートします。

...st[][ruby]{
module StrUtils
def indent(level)
' ' * level + self
end
end

module M
refine String do
import_methods StrUtils
end
end

using
M
p "foo".indent(3) # => " foo"

module M
refine String do
import_methods Enumerable
# Can't import method which is not defined with...

bigdecimal (6.0)

bigdecimal は浮動小数点数演算ライブラリです。 任意の精度で 10 進表現された浮動小数点数を扱えます。

...{
#!/usr/local/bin/ruby

require "bigdecimal"
#
# Calculates 3.1415.... (the number of times that a circle's diameter
# will fit around the circle) using J. Machin's formula.
#
def big_pi(sig) # sig: Number of significant figures
exp = -sig
pi = BigDecimal("0")
two = BigDecimal("2")...

shell (6.0)

Ruby 上で sh/csh のようにコマンドの実行及びフィルタリングを手軽に行うためのライブラリです。

...f = open("tmpFile", "w")
f.print "TEST\n"
f.close
end
print pwd
end
end
end

==== Example 3: Using Pipe

require 'shell'
sh = Shell.new
sh.cat("/etc/printcap") | sh.tee("tee1") > "tee2"
(sh.cat < "/etc/printcap") | sh.tee("tee11") > "tee...

絞り込み条件を変える

<< < ... 3 4 5 >>