438件ヒット
[1-100件を表示]
(0.031秒)
別のキーワード
ライブラリ
- ビルトイン (246)
-
mutex
_ m (11) - rake (11)
-
win32
/ registry (11) - win32ole (11)
クラス
- BasicObject (11)
- Data (4)
- Method (11)
- Module (132)
- Object (33)
- Proc (11)
- TracePoint (11)
-
WIN32OLE
_ TYPE (11) -
Win32
:: Registry :: PredefinedKey (11)
モジュール
-
Mutex
_ m (11) - ObjectSpace (33)
-
Rake
:: TaskManager (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (7) - Ruby用語集 (11)
-
class
_ exec (11) -
class
_ variable _ defined? (11) -
const
_ defined? (11) -
default
_ event _ sources (11) -
define
_ aliases (11) -
define
_ finalizer (22) -
define
_ method (22) -
define
_ singleton _ method (22) -
define
_ task (11) -
defined
_ class (11) -
instance
_ variable _ defined? (11) - lambda? (11)
-
method
_ added (11) -
method
_ defined? (11) -
method
_ undefined (11) -
module
_ exec (11) - parameters (11)
-
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
public
_ method _ defined? (11) -
rb
_ catch (11) -
rb
_ define _ class (11) -
rb
_ define _ class _ id (11) -
rb
_ define _ class _ under (11) -
rb
_ define _ class _ variable (11) -
rdoc
/ parser / c (11) -
ruby 1
. 6 feature (11) -
singleton
_ method _ undefined (11) -
undefine
_ finalizer (11) - リテラル (11)
検索結果
先頭5件
-
Win32
:: Registry :: PredefinedKey # class (21101.0) -
@todo
@todo -
Data
. define(*args) {|subclass| block } -> Class (18352.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)
fred.age = 6 #......も定義可能です。
以下のように、パターンマッチに利用できます。
//emlist[例][ruby]{
class HTTPFetcher
Response = Data.define(:body)
NotFound = Data.define
def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current......指定した場合
Data.define にブロックを指定した場合は定義した Data をコンテキストにブロックを評価します。
また、定義した Data はブロックパラメータにも渡されます。
//emlist[例][ruby]{
Customer = Data.define(:name, :address) do
def... -
Data
. define(*args) -> Class (18252.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)
fred.age = 6 #......も定義可能です。
以下のように、パターンマッチに利用できます。
//emlist[例][ruby]{
class HTTPFetcher
Response = Data.define(:body)
NotFound = Data.define
def get(url)
# ダミーの実装
if url == "http://example.com/"
Response.new(body: "Current......指定した場合
Data.define にブロックを指定した場合は定義した Data をコンテキストにブロックを評価します。
また、定義した Data はブロックパラメータにも渡されます。
//emlist[例][ruby]{
Customer = Data.define(:name, :address) do
def... -
TracePoint
# defined _ class -> Class | module (12350.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 は特異クラ
スを返します。また、K......ラメータは特異クラスではなく元のクラスを返します。
//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 の上記の差分に注... -
Module
# class _ variable _ defined?(name) -> bool (12231.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) (12206.0) -
super のサブクラスとして新しい Ruby クラスを、outer の定数として定義し て返します。
...属するクラス
@param name クラス名
@param super 継承元のクラス。NULL を指定した場合は Object クラス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。......ス。NULL を指定した場合は Object クラス
@raise TypeError 引数 name と同じ名前の定数が既に存在し、それが
Class オブジェクトではない場合に発生します。
@raise TypeError 定義済みのクラスと継承元のクラスが一致しな... -
VALUE rb
_ define _ class(const char *name , VALUE super) (12200.0) -
クラス super の下位クラス name を作成し返します。
クラス super の下位クラス name を作成し返します。 -
VALUE rb
_ define _ class _ id(ID id , VALUE super) (12200.0) -
クラス名 id でクラス super を継承したクラスを 新しく作成する。クラス→クラス名 (定数名) の関連付けは なされるが、定数→クラスの関連付けはなされない。
クラス名 id でクラス super を継承したクラスを
新しく作成する。クラス→クラス名 (定数名) の関連付けは
なされるが、定数→クラスの関連付けはなされない。 -
void rb
_ define _ class _ variable(VALUE klass , const char *name , VALUE val) (12200.0) -
クラス klass のクラス変数 name を初期値 val で 定義します。既に同名の変数が定義されていたら警告します。
クラス klass のクラス変数 name を初期値 val で
定義します。既に同名の変数が定義されていたら警告します。 -
Rake
:: TaskManager # define _ task(task _ class , *args) { . . . } -> Rake :: Task (6214.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) # =>... -
Mutex
_ m . define _ aliases(klass) -> Class (6202.0) -
ユーザが直接、使うことはありません。
ユーザが直接、使うことはありません。