るりまサーチ

最速Rubyリファレンスマニュアル検索!
262件ヒット [1-100件を表示] (0.166秒)
トップページ > クエリ:i[x] > クエリ:l[x] > クエリ:using[x]

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. csv to_i
  5. _builtin i

ライブラリ

クラス

モジュール

オブジェクト

検索結果

<< 1 2 3 > >>

main.using(module) -> self (27313.0)

引数で指定したモジュールで定義された拡張を有効にします。

...https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope

@param module 有効にするモジュールを指定します。

//emlist[例][ruby]{
module Sloth
refine String do
def downcase
self
end
end
end

"ABC".downcase # => "abc"

using
Sloth

"ABC".downcas...
...e # => "ABC"
//}

@see Module#refine, Module#using...

Module#using(module) -> self (27307.0)

引数で指定したモジュールで定義された拡張を現在のクラス、モジュールで有 効にします。

...ルで有
効にします。

有効にした拡張の有効範囲については以下を参照してください。

* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html#label-Scope

@param module 有効にするモジュールを指定します。

@see Module#refine, main.using...

Shell::ProcessController::USING_AT_EXIT_WHEN_PROCESS_EXIT -> true (18201.0)

@todo

@todo

Kernel#convertible_int(type, headers = nil, opts = nil) (12216.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...eturns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

I
f the +type+ is a integer type and _convertible_ type is found,
following macros are pass...
...mpiler using the +type+ name, in uppercase.

* 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X'
i
s the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is...
...ert +type+ to +Integer+ object, and vice versa.

For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#define NUM2FOOBART NUM2ULONG...

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (12216.0)

Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG

...eturns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.

I
f the +type+ is a integer type and _convertible_ type is found,
following macros are pass...
...mpiler using the +type+ name, in uppercase.

* 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X'
i
s the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP,
where 'TYP' is the +type+ name in uppercase with replacing '_t'
suffix with 'T', followed by '=X' where 'X' is...
...ert +type+ to +Integer+ object, and vice versa.

For example, if foobar_t is defined as unsigned long, then
convertible_int("foobar_t") would return "unsigned long", and define
macros:

#define TYPEOF_FOOBAR_T unsigned long
#define FOOBART2NUM ULONG2NUM
#define NUM2FOOBART NUM2ULONG...

絞り込み条件を変える

bigdecimal (12024.0)

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

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

//emlist[][ruby]{
require 'bigdecimal'
a = BigDecimal("0.123456789123456789")
b = BigDecimal("123456.78912345678", 40)
print a + b # => 0.123456912580245903456...
...BigDecimal では正確な値を得る事ができます。

//emlist[例1: 0.0001 を 10000 回足す場合。][ruby]{
sum = 0
for i in (1..10000)
sum = sum + 0.0001
end
print sum # => 0.9999999999999062
//}

//emlist[例2: 0.0001 を 10000 回足す場合。(BigDecimal)][ruby]{
require 'bigdecim...
...//emlist[pi.rb][ruby]{
#!/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")
tw...

Kernel#check_signedness(type, headers = nil, opts = nil) -> "signed" | "unsigned" | nil (9416.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.

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

I
f 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_', follow...
...llowed 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
compi...
...ler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Kernel#check_signedness(type, headers = nil, opts = nil) { ... } -> "signed" | "unsigned" | nil (9416.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.

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

I
f 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_', follow...
...llowed 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
compi...
...ler, and SIGNEDNESS_OF_INT=-1 if check_signedness('int') is
done....

Module#refine(klass) { ... } -> Module (9224.0)

引数 klass で指定したクラスだけに対して、ブロックで指定した機能を提供で きるモジュールを定義します。定義した機能は Module#refine を使用せずに直 接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にできます。 そのため、既存の機能を局所的に修正したい場合などに用いる事ができます。

...引数 klass で指定したクラスだけに対して、ブロックで指定した機能を提供で
きるモジュールを定義します。定義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた範囲のみ有効にで...
...ます。

refinements 機能の詳細については以下を参照してください。

* https://magazine.rubyist.net/articles/0041/0041-200Special-refinement.html
* https://docs.ruby-lang.org/en/master/syntax/refinements_rdoc.html

定義した機能は main.using, Module#using を実行し...
...

@param klass 拡張する対象のクラスを指定します。

@return ブロックで指定した機能を持つ無名のモジュールを返します。


//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end

module M
refine C do
def foo
puts "C#foo in M"
end...
...引数 klass で指定したクラスまたはモジュールだけに対して、ブロックで指定した機能を提供で
きるモジュールを定義します。定義した機能は Module#refine を使用せずに直
接 klass に対して変更を行う場合と異なり、限られた...
...klass 拡張する対象のクラスまたはモジュールを指定します。

@return ブロックで指定した機能を持つ無名のモジュールを返します。


//emlist[例][ruby]{
class C
def foo
puts "C#foo"
end
end

module M
refine C do
def foo
puts "C#foo in...

Net::POP3.auth_only(address, port = nil, account, password, isapop=false) (6206.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サーバのホスト名...
...ram password パスワード文字列
@param isapop 真でAPOPを利用します

@raise Net::POPAuthenticationError 認証に失敗した、もしくはAPOPを利用しようとしたがサーバがAPOPを提供していない場合に発生します
@raise Net::POPError サーバが認証失敗以...
...外のエラーを報告した場合に発生します
@raise Net::POPBadResponse サーバからの応答がプロトコル上不正であった場合に発生します...

絞り込み条件を変える

<< 1 2 3 > >>