るりまサーチ

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

別のキーワード

  1. etc sc_xopen_enh_i18n
  2. rsa n
  3. rsa n=
  4. openssl n
  5. openssl n=

検索結果

<< 1 2 3 ... > >>

Object#then -> Enumerator (24209.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'...
...require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条...
...件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

Object#then {|x| ... } -> object (24209.0)

self を引数としてブロックを評価し、ブロックの結果を返します。

...]{
3.next.then {|x| x**x }.to_s # => "256"
"my string".yield_self {|s| s.upcase } # => "MY STRING"
//}

値をメソッドチェインのパイプラインに次々と渡すのは良い使い方です。

//emlist[メソッドチェインのパイプライン][ruby]{
require 'open-uri'...
...require 'json'

construct_url(arguments).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}

ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。

//emlist[][ruby]{
# 条...
...件にあうので何もしない
1.yield_self.detect(&:odd?) # => 1
# 条件に合わないので値を捨てる
2.yield_self.detect(&:odd?) # => nil
//}

@see Object#tap...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (15417.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS_O...
...F_', followed by the +type+
n
ame, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.

For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso...
...r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (15417.0)

Returns the signedness of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. If the +type+ is found and is a numeric type, a macro is passed as a preprocessor constant to the compiler using the +type+ name, in uppercase, prepended with 'SIGNEDNESS_OF_', followed by the +type+ name, followed by '=X' where 'X' is positive integer if the +type+ is unsigned, or negative integer if the +type+ is signed. For example, if size_t is defined as unsigned, then check_signedness('size_t') would returned +1 and the SIGNEDNESS_OF_SIZE_T=+1 preprocessor macro would be passed to the compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is done.

...Returns the signedness of the given +type+. You may optionally
specify additional +headers+ to search in for the +type+.

If the +type+ is found and is a numeric type, a macro is passed as a
preprocessor constant to the compiler using the +type+ name, in
uppercase, prepended with 'SIGNEDNESS_O...
...F_', followed by the +type+
n
ame, followed by '=X' where 'X' is positive integer if the +type+ is
unsigned, or negative integer if the +type+ is signed.

For example, if size_t is defined as unsigned, then
check_signedness('size_t') would returned +1 and the
SIGNEDNESS_OF_SIZE_T=+1 preprocesso...
...r macro would be passed to the
compiler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Prime::EratosthenesGenerator#next -> Integer (15101.0)

次の(擬似)素数を返します。なお、この実装においては擬似素数は真に素数です。

...いては擬似素数は真に素数です。

また内部的な列挙位置を進めます。

//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.succ #=> 5
p generator.succ #=> 7
p generator.next #=> 11
//}...

絞り込み条件を変える

Net::IMAP#authenticate(auth_type, user, password) -> Net::IMAP::TaggedResponse (12201.0)

AUTHENTICATE コマンドを送り、クライアントを認証します。

...AUTHENTICATE コマンドを送り、クライアントを認証します。

auth_type で利用する認証方式を文字列で指定します。


例:
imap.authenticate('LOGIN', user, password)

auth_type としては以下がサポートされています。
* "LOGIN"
* "PLAIN"
* "CRA...
...M-MD5"
* "DIGEST-MD5"

@param auth_type 認証方式を表す文字列
@param user ユーザ名文字列
@param password パスワード文字列
@see Net::IMAP#login...

Net::SMTP#authenticate(user, secret, authtype) -> () (12201.0)

認証を行います。

...認証を行います。

このメソッドはセッション開始(Net::SMTP#start)後、
メールを送る前に呼びだしてください。

通常は Net::SMTP.start や Net::SMTP#start で認証を
行うためこれを利用する必要はないはずです。

@param user 認証で使う...
...アカウント名
@param secret 認証で使うパスワード
@param authtype 認証の種類(:plain, :login, :cram_md5 のいずれか)

@see Net::SMTP.start, Net::SMTP#start, Net::SMTP#auth_plain, Net::SMTP#auth_login, Net::SMTP#auth_cram_md5...

WEBrick::HTTPAuth::BasicAuth#authenticate(request, response) -> bool (12201.0)

クライアントから送られてきたユーザ名とパスワードを認証します。 認証に失敗した場合は challenge を呼びます。

...
認証に失敗した場合は challenge を呼びます。

@param request WEBrick::HTTPRequest のインスタンスを指定します。

@param response WEBrick::HTTPResponse のインスタンスを指定します。

@raise WEBrick::HTTPStatus::Unauthorized 認証に失敗した場合に...

WEBrick::HTTPAuth::DigestAuth#authenticate(request, response) -> true (12201.0)

クライアントから送られてきたユーザ名とパスワードを認証します。 認証に失敗した場合は challenge を呼びます。

...
認証に失敗した場合は challenge を呼びます。

@param request WEBrick::HTTPRequest のインスタンスを指定します。

@param response WEBrick::HTTPResponse のインスタンスを指定します。

@raise WEBrick::HTTPStatus::Unauthorized 認証に失敗した場合に...

Prime::EratosthenesGenerator#rewind -> nil (12101.0)

列挙状態を巻き戻します。

...列挙状態を巻き戻します。

//emlist[例][ruby]{
require 'prime'
generator = Prime::EratosthenesGenerator.new
p generator.next #=> 2
p generator.next #=> 3
p generator.next #=> 5

generator.rewind

p generator.next #=> 2
//}...

絞り込み条件を変える

<< 1 2 3 ... > >>