るりまサーチ (Ruby 2.5.0)

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

別のキーワード

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

検索結果

Rake::GemPackageTask#define (72607.0)

タスクを定義します。

タスクを定義します。

GemPackageTask.new にブロックが与えられている場合に、自動的に呼び出されます。

Rake::PackageTask#define -> self (72607.0)

タスクを定義します。

タスクを定義します。

@raise RuntimeError バージョン情報をセットしていない場合に発生します。
初期化時に :noversion が指定されている場合は発生しません。

Rake::RDocTask#define -> self (72607.0)

タスクを定義します。

タスクを定義します。

Rake::TestTask#define -> self (72607.0)

タスクを定義します。

タスクを定義します。

Encoding::UndefinedConversionError#destination_encoding -> Encoding (63904.0)

エラーを発生させた変換の変換先のエンコーディングを Encoding オブジェクトで返します。

エラーを発生させた変換の変換先のエンコーディングを Encoding
オブジェクトで返します。

@see Encoding::UndefinedConversionError#source_encoding

絞り込み条件を変える

Encoding::UndefinedConversionError#destination_encoding_name -> String (63904.0)

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

エラーを発生させた変換の変換先のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#destination_encoding

Object#define_singleton_method(symbol) { ... } -> Symbol (55018.0)

self に特異メソッド name を定義します。

self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_me...

Object#define_singleton_method(symbol, method) -> Symbol (55018.0)

self に特異メソッド name を定義します。

self に特異メソッド name を定義します。

@param symbol メソッド名を String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_me...

Object#instance_variable_defined?(var) -> bool (54904.0)

インスタンス変数 var が定義されていたら真を返します。

インスタンス変数 var が定義されていたら真を返します。

@param var インスタンス変数名を文字列か Symbol で指定します。

//emlist[][ruby]{
class Fred
def initialize(p1, p2)
@a, @b = p1, p2
end
end
fred = Fred.new('cat', 99)
p fred.instance_variable_defined?(:@a) #=> true
p fred.instance_variable_defined?("@b") #=> true
p fred.instan...

RDoc::Context#defined_in?(file) (54904.0)

Return true if at least part of this thing was defined in file

Return true if at least part of this thing was defined in file

絞り込み条件を変える

Binding#local_variable_defined?(symbol) -> bool (54604.0)

引数 symbol で指定した名前のローカル変数が定義されている場合に true を、 そうでない場合に false を返します。

引数 symbol で指定した名前のローカル変数が定義されている場合に true を、
そうでない場合に false を返します。

@param symbol ローカル変数名を Symbol オブジェクトで指定します。

//emlist[例][ruby]{
def foo
a = 1
binding.local_variable_defined?(:a) # => true
binding.local_variable_defined?(:b) # => false
end
//}

このメソッドは以下のコードの短縮形です。

//emlist[][ruby]{
bindin...

BasicObject#singleton_method_undefined(name) -> object (45904.0)

特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。

特異メソッドが Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。

通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。

@param name 未定義にされたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end

obj...

Encoding::UndefinedConversionError#source_encoding -> Encoding (45604.0)

エラーを発生させた変換の変換元のエンコーディングを Encoding オブジェクトで返します。

エラーを発生させた変換の変換元のエンコーディングを Encoding
オブジェクトで返します。

変換が多段階になされる場合は元の文字列のものではない
エンコーディングが返される場合があることに注意してください。

@see Encoding::UndefinedConversionError#destination_encoding

Encoding::UndefinedConversionError#source_encoding_name -> Encoding (45604.0)

エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

エラーを発生させた変換の変換元のエンコーディングを文字列で返します。

@see Encoding::UndefinedConversionError#source_encoding

TracePoint#defined_class -> Class | module (45604.0)

メソッドを定義したクラスかモジュールを返します。

メソッドを定義したクラスかモジュールを返します。

//emlist[例][ruby]{
class C; def foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}

メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します。

//emlist[例][ruby]{
module M; def foo; end; end
class C; include M; end;
trac...

絞り込み条件を変える

Module#const_defined?(name, inherit = true) -> bool (36904.0)

モジュールに name で指定される名前の定数が定義されている時真 を返します。

モジュールに name で指定される名前の定数が定義されている時真
を返します。

スーパークラスや include したモジュールで定義された定数を検索対象
にするかどうかは第二引数で制御することができます。

@param name String, Symbol で指定される定数名。

@param inherit false を指定するとスーパークラスや include したモジュールで
定義された定数は対象にはなりません。


//emlist[例][ruby]{
module Kernel
FOO = 1
end

# Object は include したモジュ...

Module#define_method(name) { ... } -> Symbol (36628.0)

インスタンスメソッド name を定義します。

インスタンスメソッド name を定義します。

ブロックを与えた場合、定義したメソッドの実行時にブロックが
レシーバクラスのインスタンスの上で BasicObject#instance_eval されます。

@param name メソッド名を String または Symbol を指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

@raise TypeError method に同じクラス、サブクラス、モジュー...

Module#define_method(name, method) -> Symbol (36628.0)

インスタンスメソッド name を定義します。

インスタンスメソッド name を定義します。

ブロックを与えた場合、定義したメソッドの実行時にブロックが
レシーバクラスのインスタンスの上で BasicObject#instance_eval されます。

@param name メソッド名を String または Symbol を指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

@raise TypeError method に同じクラス、サブクラス、モジュー...

Rake::TaskManager#define_task(task_class, *args) { ... } -> Rake::Task (36625.0)

タスクを定義します。

タスクを定義します。

@param task_class タスククラスを指定します。

@param args タスクに渡すパラメータを指定します。

//emlist[][ruby]{
# Rakefile での記載例とする

task default: :test_rake_app
task :test_rake_app do
Rake.application.define_task(Rake::Task, :t) # => <Rake::Task t => []>
end
//}

Module#class_variable_defined?(name) -> bool (36604.0)

name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。

name で与えられた名前のクラス変数がモジュールに存在する場合 true を
返します。

@param name Symbol か String を指定します。

//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable...

絞り込み条件を変える

Module#method_defined?(name) -> bool (36604.0)

モジュールにインスタンスメソッド name が定義されており、 かつその可視性が public または protected であるときに true を返します。

モジュールにインスタンスメソッド name が定義されており、
かつその可視性が public または protected であるときに
true を返します。

@param name Symbol か String を指定します。

@see Module#public_method_defined?, Module#private_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module A
def method1() end
def protected_method1() en...

Module#method_undefined(name) -> () (36604.0)

このモジュールのインスタンスメソッド name が Module#undef_method によって削除されるか、 undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。

このモジュールのインスタンスメソッド name が
Module#undef_method によって削除されるか、
undef 文により未定義にされると、インタプリタがこのメソッドを呼び出します。

特異メソッドの削除をフックするには
BasicObject#singleton_method_undefined
を使います。

@param name 削除/未定義にされたメソッド名が Symbol で渡されます。

//emlist[例][ruby]{
class C
def C.method_undefined(name)
puts "method C\##{name} was...

Module#private_method_defined?(name) -> bool (36604.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が private であるときに true を返します。 そうでなければ false を返します。

インスタンスメソッド name がモジュールに定義されており、
しかもその可視性が private であるときに true を返します。
そうでなければ false を返します。

@param name Symbol か String を指定します。

@see Module#method_defined?, Module#public_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module A
def method1() end
end
class B
private
def ...

Module#protected_method_defined?(name) -> bool (36604.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が protected であるときに true を返します。 そうでなければ false を返します。

インスタンスメソッド name がモジュールに定義されており、
しかもその可視性が protected であるときに true を返します。
そうでなければ false を返します。

@param name Symbol か String を指定します。

@see Module#method_defined?, Module#public_method_defined?, Module#private_method_defined?

//emlist[例][ruby]{
module A
def method1() end
end
class B
protected
de...

Module#public_method_defined?(name) -> bool (36604.0)

インスタンスメソッド name がモジュールに定義されており、 しかもその可視性が public であるときに true を返します。 そうでなければ false を返します。

インスタンスメソッド name がモジュールに定義されており、
しかもその可視性が public であるときに true を返します。
そうでなければ false を返します。

@param name Symbol か String を指定します。

@see Module#method_defined?, Module#private_method_defined?, Module#protected_method_defined?

//emlist[例][ruby]{
module A
def method1() end
end
class B
protected
de...

絞り込み条件を変える

Encoding::UndefinedConversionError#error_char -> String (27304.0)

エラーを発生させた1文字を文字列で返します。

エラーを発生させた1文字を文字列で返します。

//emlist[例][ruby]{
ec = Encoding::Converter.new("UTF-8", "EUC-JP")
begin
ec.convert("\u{a0}")
rescue Encoding::UndefinedConversionError
puts $!.error_char.dump #=> "\u{a0}"
end
//}

Win32::Registry::PredefinedKey#class (27004.0)

@todo

@todo

Win32::Registry::PredefinedKey#close (27004.0)

@todo

@todo

Kernel#file(*args) { ... } -> Rake::FileTask (18622.0)

ファイルタスクを定義します。

ファイルタスクを定義します。

@param args ファイル名と依存ファイル名を指定します。

例:
file "config.cfg" => ["config.template"] do
open("config.cfg", "w") do |outfile|
open("config.template") do |infile|
while line = infile.gets
outfile.puts line
end
end
end
end

@see Rake:...

Kernel#convertible_int(type, headers = nil, opts = nil) (18496.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

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 p...

絞り込み条件を変える

Kernel#convertible_int(type, headers = nil, opts = nil) { ... } (18496.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

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 p...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (9322.0)

型が持つソースインターフェイスを取得します。

型が持つソースインターフェイスを取得します。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるインターフェイス)を返します。

@return デフォルトのソースインターフェイスをWIN32OLE_TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は空配列を返します。

tobj = ...

Kernel#create_header(header = "extconf.h") -> String (358.0)

Kernel#have_func, Kernel#have_header などの検査結果を元に、 ヘッダファイルを生成します。

Kernel#have_func, Kernel#have_header などの検査結果を元に、
ヘッダファイルを生成します。

このメソッドは extconf.rb の最後で呼び出すようにしてください。

@param header ヘッダファイルの名前を指定します。

@return ヘッダファイルの名前を返します。



# extconf.rb
require 'mkmf'
have_func('realpath')
have_header('sys/utime.h')
create_header
create_makefile('foo')

上の ext...