るりまサーチ

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

別のキーワード

  1. _builtin nil?
  2. nilclass nil?
  3. object nil?
  4. _builtin nil
  5. object nil

検索結果

<< 1 2 > >>

Class#superclass -> Class | nil (18250.0)

自身のスーパークラスを返します。

...ile.superclass #=> IO
IO.superclass #=> Object
class Foo; end
class Bar < Foo; end
Bar.superclass #=> Foo
Object.superclass #=> BasicObject
//}

ただし BasicObject.superclass nil を返します。

//emlist[例][ruby]{
BasicObject.superclass #=> nil
//}...

1.6.8から1.8.0への変更点(まとめ) (396.0)

1.6.8から1.8.0への変更点(まとめ) * ((<1.6.8から1.8.0への変更点(まとめ)/インタプリタの変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたクラス/モジュール>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加されたメソッド>)) * ((<1.6.8から1.8.0への変更点(まとめ)/追加された定数>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張されたクラス/メソッド(互換性のある変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/変更されたクラス/メソッド(互換性のない変更)>)) * ((<1.6.8から1.8.0への変更点(まとめ)/文法の変更>)) * ((<1.6.8から1.8.0への変更点(まとめ)/正規表現>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Marshal>)) * ((<1.6.8から1.8.0への変更点(まとめ)/Windows 対応>)) * ((<1.6.8から1.8.0への変更点(まとめ)/廃止された(される予定の)機能>)) * ((<1.6.8から1.8.0への変更点(まとめ)/ライブラリ>)) * ((<1.6.8から1.8.0への変更点(まとめ)/拡張ライブラリAPI>)) * ((<1.6.8から1.8.0への変更点(まとめ)/バグ修正>)) * ((<1.6.8から1.8.0への変更点(まとめ)/サポートプラットフォームの追加>))

...りました。
* nil: 警告を出力しない (-W0 新しい警告レベル)
* false: 重要な警告のみ出力 (-W1 デフォルト)
* true: すべての警告を出力する (-W2 or -W or -v or -w or --verbose)

追加された -W オプションは $VERBOSE = nil の指定(-W0)を...
...っぱりわかりません(^^;;

class << Object.new
class << self.superclass
p [self.id, self]
end
class << self
p [self.superclass.id, self.superclass]
end
end
=> ruby 1.6.7 (2002-03-01) [i586-linux]...
...from -:1
ruby 1.6.8 (2002-12-24) [i586-linux]
=> ruby 1.8.0 (2003-06-21) [i586-linux]
[1, 2, nil]

Proc.new { break }.call

=> ruby 1.6.8 (2002-12-24) [i586-linux]

=> -:1:in `call': break from proc-c...

ruby 1.6 feature (270.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

... nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)

p "foo".slice!("bar") # <- 以前からこちらは nil を返していた
p "foo".slice!(5,10)

=> ruby 1.6.7 (2002-03-01) [i586-linux]
nil
...
...: index 5 out of string (IndexError)
from -:2
=> ruby 1.6.7 (2002-08-01) [i586-linux]
nil

nil


: 2002-07-05 String#split

最初の引数に nil を指定できるようになりました。((<ruby-talk:43513>))
この場合、$; を分割文字列...
...れていません
でした。((<ruby-bugs-ja:PR#87>))

class A
p self.id
end
class A < String
p self.id
p self.superclass
end

=> ruby 1.6.5 (2001-09-19) [i586-linux]
537760880
-:4: warning: already initialized constant A
537757180...

RDoc::Context#add_class_or_module(collection, class_type, name, superclass = nil) -> RDoc::NormalClass | RDoc::SingleClass | RDoc::NormalModule (208.0)

collection に name で指定したクラス、モジュールを追加します。

...dule オ
ブジェクトのいずれかで指定します。

@param name クラス名を文字列で指定します。

@param superclass 追加するクラスの親クラスを RDoc::NormalClass オ
ブジェクトで指定します。

既に登録済みであ...

Class.new(superclass = Object) -> Class (136.0)

新しく名前の付いていない superclass のサブクラスを生成します。

...新しく名前の付いていない superclass のサブクラスを生成します。

名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。

//emlist[例][ruby]{
p foo = Class.new # =>...
...#<Class:0x401b90f8>
p foo.name # => nil
Foo = foo # ここで p foo すれば "Foo" 固定
Bar = foo
p foo.name # => "Bar" ("Foo" になるか "Bar" になるかは不定)
//}

ブロックが与えられた場合、生成したクラスを引数として
クラスの...
...じです。

//emlist[例][ruby]{
klass = Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}

この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。

@param superclass 生成するクラスのスーパークラスを指定...

絞り込み条件を変える

Class.new(superclass = Object) {|klass| ... } -> Class (136.0)

新しく名前の付いていない superclass のサブクラスを生成します。

...新しく名前の付いていない superclass のサブクラスを生成します。

名前のないクラスは、最初に名前を求める際に代入されている定数名を検
索し、見つかった定数名をクラス名とします。

//emlist[例][ruby]{
p foo = Class.new # =>...
...#<Class:0x401b90f8>
p foo.name # => nil
Foo = foo # ここで p foo すれば "Foo" 固定
Bar = foo
p foo.name # => "Bar" ("Foo" になるか "Bar" になるかは不定)
//}

ブロックが与えられた場合、生成したクラスを引数として
クラスの...
...じです。

//emlist[例][ruby]{
klass = Class.new(superclass)
klass.module_eval {|m|
# ...
}
klass
//}

この場合も生成したクラスを返します。
ブロックの実行は Class#initialize が行います。

@param superclass 生成するクラスのスーパークラスを指定...

クラス/メソッドの定義 (120.0)

クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined

...class Foo < Super
def test
# ...
end
# ...
end
//}

文法:

class 識別子 [`<' superclass ]
式..
end

文法:

class 識別子 [`<' superclass ]
式..
[rescue [error_type,..] [=> evar] [then]
式..].....
...指定しても同じ)
class Foo
def bar
end
end

# 間違ったスーパークラスを指定するとエラー
class Foo < String
end
# => superclass mismatch for class Foo (TypeError)
//}

クラス定義式の中は self がそのクラスであることと、
limitのデフォルトが異...
...た式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。

===[a:singleton_class] 特異クラス定義

//emlist[例][ruby]{
obj = Object.new # obj = nil でも可
class << obj
def test
# ...
end
# ...
end
//}

文法:

class...

Method#super_method -> Method | nil (113.0)

self 内で super を実行した際に実行されるメソッドを Method オブジェ クトにして返します。

...][ruby]{
class Super
def foo
"superclass method"
end
end

class Sub < Super
def foo
"subclass method"
end
end

m = Sub.new.method(:foo) # => #<Method: Sub#foo>
m.call # => "subclass method"
m.super_method # => #<Method: Super#foo>
m.super_method.call # => "superclass method"
//}...

ruby 1.8.2 feature (102.0)

ruby 1.8.2 feature ruby 1.8.2 での ruby 1.8.1 からの変更点です。

...子以外では nil を 0 に変換しなくなりました。

$ ruby-1.8.1 -e 'p [nil].pack("L")'
"\000\000\000\000"

$ ruby-1.8.2 -e 'p [nil].pack("L")'
-e:1:in `pack': cannot convert nil into Integer (TypeError)
from -e:1

$ ruby-1.8.2 -e 'p [nil].pack("P")'...
...ても適切に振舞うようになりました。((<ruby-dev:24460>))

: Dir.glob [change]
ブロックを渡したとき、false ではなく nil を返すようになりました。また、readdir しながらブロックを呼ぶのではなく、全部を配列に貯めてから each する...
...000def\000".unpack("Z*Z*")'
["abc\000def", ""]

$ ruby1.8.2 -e 'p "abc\000def\000".unpack("Z*Z*")'
["abc", "def"]

=== 2004-05-10
: superclass mismatch [ruby] [change]
親クラスの違う同じ名前のクラスを再定義した時 TypeError を投げるようになりました...

Ruby用語集 (60.0)

Ruby用語集 A B C D E F G I J M N O R S Y

...持つ。

https://mruby.org/

: main
トップレベルにおける self。Object クラスのインスタンスである。

===[a:N] N

: nil
Nil
Class の唯一のインスタンス。また、そのオブジェクトを指す擬似変数の名前。
論理値としては偽である。...
...ーバーとメソッド名を結ぶ演算子の一つ「&.」。
「.」と違う点は、レシーバーが nil のとき引数の評価もメソッド呼び出しも行わずに nil
返す、ということだけである。
Ruby 2.3 で導入された。
俗に「ぼっち演算子...
...、true 以外のオブジェクトを
返すことで、単なる真偽を越えた情報を与えるものもある。

: 上位クラス
: superclass
=スーパークラス

: 条件演算子
: conditional operator
条件式・真式・偽式の三つの項を取り、条件式の値が...

絞り込み条件を変える

<< 1 2 > >>