990件ヒット
[1-100件を表示]
(0.112秒)
ライブラリ
- ビルトイン (280)
- mkmf (33)
-
mutex
_ m (11) - rake (66)
-
rake
/ packagetask (11) -
rake
/ rdoctask (11) -
rake
/ testtask (11) -
rdoc
/ context (11) - rexml (11)
-
rexml
/ document (22) -
shell
/ error (6) -
win32
/ registry (22) - win32ole (22)
クラス
- BasicObject (11)
- Binding (11)
- Data (16)
- Module (132)
- Object (33)
- Proc (11)
-
RDoc
:: Context (11) -
REXML
:: Element (22) -
Rake
:: FileList (22) -
Rake
:: PackageTask (11) -
Rake
:: RDocTask (11) -
Rake
:: Task (11) -
Rake
:: TestTask (11) - TracePoint (11)
-
WIN32OLE
_ TYPE (11) -
Win32
:: Registry :: PredefinedKey (22)
モジュール
- Kernel (55)
-
Mutex
_ m (11) - ObjectSpace (33)
-
Rake
:: TaskManager (11) -
WIN32OLE
:: VARIANT (11)
オブジェクト
- main (22)
キーワード
- == (2)
- CantDefine (6)
-
MUST
_ DEFINE (11) -
MUST
_ NOT _ DEFINE (11) - Ruby用語集 (11)
- UNDEFINED (11)
- UndefinedNamespaceException (11)
-
VT
_ USERDEFINED (11) -
arg
_ defined (11) - bigdecimal (11)
- class (11)
-
class
_ exec (11) -
class
_ variable _ defined? (11) - close (11)
-
const
_ defined? (11) -
convertible
_ int (22) -
create
_ header (11) -
deconstruct
_ keys (2) -
default
_ event _ sources (11) -
define
_ aliases (11) -
define
_ final (11) -
define
_ finalizer (22) -
define
_ method (44) -
define
_ singleton _ method (22) -
define
_ task (11) -
defined
_ class (11) -
defined
_ in? (11) - eql? (2)
-
ev
_ const _ defined (11) - file (11)
-
generic
_ ivar _ defined (11) -
instance
_ variable _ defined? (11) -
is
_ defined (11) - lambda? (11)
-
local
_ variable _ defined? (11) - members (4)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ undefined (11) -
module
_ exec (11) - new (11)
-
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11) -
rb
_ autoload _ defined (11) -
rb
_ catch (11) -
rb
_ const _ defined (11) -
rb
_ const _ defined _ at (11) -
rb
_ cvar _ defined (11) -
rb
_ define _ alias (11) -
rb
_ define _ attr (11) -
rb
_ define _ class (11) -
rb
_ define _ class _ id (11) -
rb
_ define _ class _ under (11) -
rb
_ define _ class _ variable (11) -
rb
_ define _ const (11) -
rb
_ define _ global _ const (11) -
rb
_ define _ global _ function (11) -
rb
_ define _ hooked _ variable (11) -
rb
_ define _ method (11) -
rb
_ define _ method _ id (11) -
rb
_ define _ module (11) -
rb
_ define _ module _ function (11) -
rb
_ define _ module _ id (11) -
rb
_ define _ module _ under (11) -
rb
_ define _ private _ method (11) -
rb
_ define _ protected _ method (11) -
rb
_ define _ readonly _ variable (11) -
rb
_ define _ singleton _ method (11) -
rb
_ define _ variable (11) -
rb
_ define _ virtual _ variable (11) -
rb
_ dvar _ defined (11) -
rb
_ gvar _ defined (11) -
rb
_ ivar _ defined (11) -
rb
_ mod _ const _ defined (11) -
rb
_ mod _ define _ method (11) -
rb
_ mod _ method _ defined (11) -
rb
_ undefined (11) -
singleton
_ method _ undefined (11) - task (11)
-
task
_ defined? (11) -
to
_ h (2) -
undefine
_ final (11) -
undefine
_ finalizer (11) - リテラル (11)
検索結果
先頭5件
-
Data
. define(*args) {|subclass| block } -> Class (18344.0) -
Data クラスに新しいサブクラスを作って、それを返します。
...ドが定義されています。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}
メンバの値を書き換えることはできません。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)......//emlist[例][ruby]{
class HTTPFetcher
Response = Data.define(:body)
NotFound = Data.define
def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end
def fetch(url)
fetch......er = HTTPFetcher.new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end
p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}
@param args 値オブ... -
Data
. define(*args) -> Class (18244.0) -
Data クラスに新しいサブクラスを作って、それを返します。
...ドが定義されています。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)
p fred.name # => "Fred"
p fred.age # => 5
//}
メンバの値を書き換えることはできません。
//emlist[例][ruby]{
Dog = Data.define(:name, :age)
fred = Dog.new("Fred", 5)......//emlist[例][ruby]{
class HTTPFetcher
Response = Data.define(:body)
NotFound = Data.define
def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current time is #{Time.now}")
else
NotFound.new
end
end
end
def fetch(url)
fetch......er = HTTPFetcher.new
case fetcher.get(url)
in HTTPFetcher::Response(body)
body
in HTTPFetcher::NotFound
:NotFound
end
end
p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}
@param args 値オブ... -
Rake
:: PackageTask # define -> self (18201.0) -
タスクを定義します。
タスクを定義します。
@raise RuntimeError バージョン情報をセットしていない場合に発生します。
初期化時に :noversion が指定されている場合は発生しません。 -
Rake
:: RDocTask # define -> self (18201.0) -
タスクを定義します。
タスクを定義します。 -
Rake
:: TestTask # define -> self (18201.0) -
タスクを定義します。
タスクを定義します。 -
Module
# class _ variable _ defined?(name) -> bool (15200.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...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_defined?('@@bar') #=> false
//}... -
VALUE rb
_ define _ class _ under(VALUE outer , const char *name , VALUE super) (12400.0) -
super のサブクラスとして新しい Ruby クラスを、outer の定数として定義し て返します。
...属するクラス
@param name クラス名
@param super 継承元のクラス。NULL を指定した場合は Object クラス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。......クラス
@param name クラス名
@param super 継承元のクラス。NULL を指定した場合は Object クラス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。
@raise TypeE... -
static VALUE define
_ final(int argc , VALUE *argv , VALUE os) (12400.0) -
-
static VALUE undefine
_ final(VALUE os , VALUE obj) (12400.0) -
-
void rb
_ define _ module _ function(VALUE module , const char *name , VALUE (*func)() , int argc) (12316.0) -
モジュール module にモジュール関数 name を定義します。 func と argc は rb_define_method と同じです。
...モジュール module にモジュール関数 name を定義します。
func と argc は rb_define_method と同じです。... -
TracePoint
# defined _ class -> Class | module (12300.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;
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => M
end.enable do
C.new.foo
end
//}
[注意] 特異メソッドを実行した場合は TracePoint#defined_class は特異クラ
スを返します。また、Kernel.#set_trace_func の 6......は特異クラスではなく元のクラスを返します。
//emlist[例][ruby]{
class C; def self.foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => #<Class:C>
end.enable do
C.foo
end
//}
Kernel.#set_trace_func と TracePoint の上記の差分に注意して
く...