るりまサーチ

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

別のキーワード

  1. _builtin arg
  2. etc sc_arg_max
  3. mkmf arg_config
  4. task arg_names
  5. float arg

検索結果

<< 1 2 3 > >>

static char * arg_defined(VALUE self, NODE *node, char *buf, char *type) (32200.0)

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)
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 time is #{Time.now}")...
...d

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトのクラスを定義するための可変長引数。Symbol または String を指定します。

@return Data のサブ...

Data.define(*args) {|subclass| block } -> 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)
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 time is #{Time.now}")...
...d

p fetch("http://example.com/") # => "Current time is 2023-01-10 10:00:53 +0900"
p fetch("http://example.com/404") # => :NotFound
//}

@param args 値オブジェクトのクラスを定義するための可変長引数。Symbol または String を指定します。

@return Data のサブ...

static VALUE define_final(int argc, VALUE *argv, VALUE os) (6300.0)

static VALUE rb_mod_define_method(int argc, VALUE *argv, VALUE mod) (6300.0)

絞り込み条件を変える

static VALUE rb_undefined(VALUE obj, ID id, int argc, VALUE *argv, int call_status) (6300.0)

void rb_define_global_function(const char *name, VALUE (*func)(), int argc) (6222.0)

関数 name を定義します。 func と argc は rb_define_method と同じです。

...を定義します。
func と argc は rb_define_method と同じです。

例:
static VALUE
return_obj_dup(VALUE obj)
{
VALUE dup = rb_obj_dup(obj); // オブジェクトを複製
return dup;
}

void Init_func() {
rb_define_global_function("dup_obj", re...

void rb_define_method_id(VALUE klass, ID name, VALUE (*func)(), int argc) (6216.0)

klass に public メソッド name を定義します。 その実体は関数 func です。また argc の意味は rb_define_method と同じです。

...klass に public メソッド name を定義します。
その実体は関数 func です。また argc の意味は
rb_define_method と同じです。...

void rb_define_module_function(VALUE module, const char *name, VALUE (*func)(), int argc) (6216.0)

モジュール module にモジュール関数 name を定義します。 func と argc は rb_define_method と同じです。

...モジュール module にモジュール関数 name を定義します。
func と argc は rb_define_method と同じです。...

void rb_define_private_method(VALUE klass, const char *name, VALUE(*func)(), int argc) (6216.0)

クラス klass にプライベートインスタンスメソッド name を 定義します。その実体は関数 func であり、その関数がとる 引数のタイプを argc で指定します。argc のフォーマットに ついては rb_define_method の項を参照してください。

...ラス klass にプライベートインスタンスメソッド name を
定義します。その実体は関数 func であり、その関数がとる
引数のタイプを argc で指定します。argc のフォーマットに
ついては rb_define_method の項を参照してください。...

絞り込み条件を変える

<< 1 2 3 > >>