るりまサーチ

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

別のキーワード

  1. objectspace each_object
  2. _builtin each_object
  3. object send
  4. object enum_for
  5. object to_enum

検索結果

<< 1 2 > >>

Class#superclass -> Class | nil (18262.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への変更点(まとめ) (816.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)を...
...スは特異クラス自身であると定義されました
((<ruby-bugs-ja:313>))。なんだかよくわかりません(^^;

class << Object
p [self.id, self]
class << self
p [self.id, self]
end
end
=> ruby 1.6.7 (2002-03-01) [i5...
...ja:324>))。さあっぱりわかりません(^^;;

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) [i58...

ruby 1.6 feature (360.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
...
...upport for multipart form.

: 2002-04-10: Object#((<Object/remove_instance_variable>))

指定したインスタンス変数が定義されていない場合例外 NameError を起こ
すようになりました。((<ruby-bugs-ja:PR#216>))

Object
.new.instance_eval {
p remove_i...
...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
Object

=> ruby 1.6.5 (2001-10-10) [i586-linux]
537760960...

Class.new(superclass = Object) -> Class (238.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 (238.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 生成するクラスのスーパークラスを指定...

絞り込み条件を変える

クラス/メソッドの定義 (162.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]
式..].....
...た式の結果を返します。最後に評価した式
が値を返さない場合は nil を返します。

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

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

文法:

class...
...義したメソッドや定数は指定した
オブジェクトに対してだけ有効になります。
Object
#clone で生成したオブジェクトには引き継がれますが,
Object
#dup で生成したオブジェクトには引き継がれません.

rescue/ensure 節を指定し、...

Ruby用語集 (150.0)

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

...称は interactive Ruby から。

参照:irb

: is-a 関係
Ruby では Object#is_a? で確認できる関係。

たとえば、配列オブジェクトは Array クラスや Enumerable モジュール、Object クラス
などに対して is_a? の関係にある。

: ISO/IEC 30170
J...
...ト組込みに適した特徴を持つ。

https://mruby.org/

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

===[a:N] N

: nil
Nil
Class の唯一のインスタンス。また、そのオブジェクトを指す擬似変数の名前。
...
...、true 以外のオブジェクトを
返すことで、単なる真偽を越えた情報を与えるものもある。

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

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

ruby 1.8.2 feature (126.0)

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

...SSL::X509::Name.parse_rfc2253 [lib] [new]
new method to parse RFC2253 DN format.

=== 2004-12-18

: Object#id [ruby] [obsolete]
常に警告がでるようになりました。Object#object_id を使って下さい。

=== 2004-12-17
: CGI::Session#initialize [lib] [compat]
'no_hidden' オ...
...子以外では 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")'...
...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 1.8.4 feature (72.0)

ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。

...[i686-linux]
-:1: empty symbol literal

: Symbol [bug]

#Sat Oct 22 13:26:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
#
# * object.c (sym_inspect), parse.y (parser_yylex, rb_symname_p): check
# if valid as a symbol name more strictly. [ruby-dev:27478]
#
# * tes...
...しないsuperclass
にアクセスしようとするバグの修正。

module Kernel
def foo
super
end
end

foo

# => ruby 1.8.3 (2005-09-21) [i686-linux]
-:3:in `foo': method `foo' called on terminated object (0xb7e0...
...z]+x[0-9]+$/ =~ "hogex111")
p(/^[\x61-\x7a]+x[0-9]+$/ =~ "hogex111")

# => ruby 1.8.3 (2005-09-21) [i686-linux]
0
nil

# => ruby 1.8.4 (2005-12-22) [i686-linux]
0
0

: シグナル [bug]

#Sun Oct 16 03:38:07 2005 Yukihiro M...

ruby 1.8.3 feature (60.0)

ruby 1.8.3 feature *((<ruby 1.8 feature>)) *((<ruby 1.8.2 feature>))

...y-talk:146894>))
$ cat test_dlg.rb
foo = Object.new
foo2 = SimpleDelegator.new(foo)
def foo.bar
puts "bar"
end
foo2.bar

$ ruby-1.8.2 -r delegate test_dlg.rb
test_dlg.rb:6: undefined method `bar' for #<Object:0x4021b0a0> (NoMethodError)

$ ruby-1....
...オプションに -w を付けた時に出ます。((<ruby-dev:26201>))

=== 2005-05-22
: OpenSSL::SSL::SSLServer#initialize(svr, ctx, session_id=nil)
session_id を受け付けるようになりました。((<ruby-core:4663>))

=== 2005-05-19
: REXML::Encoding#decode_sjis [lib] [bug]
: REXML::...
...er [lib] [bug]

継承するとエラーになるバグを修正。 ((<ruby-talk:126104>))

=== 2005-01-12
: Class#superclass [ruby] [bug]
特異クラスのメソッド superclass が特異クラスを返すように修正されました。
((<ruby-list:40519>))

=== 2005-01-09

: IO#read [ob...

絞り込み条件を変える

<< 1 2 > >>