るりまサーチ (Ruby 2.2.0)

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.030秒)
トップページ > クラス:Module[x] > クエリ:to_s[x] > バージョン:2.2.0[x]

別のキーワード

  1. _builtin to_s
  2. openssl to_der
  3. openssl to_s
  4. _builtin to_a
  5. openssl to_pem

ライブラリ

キーワード

検索結果

Module#to_s -> String (45343.0)

モジュールやクラスの名前を文字列で返します。

...t[例][ruby]{
module
A
module
B
end

p B.name #=> "A::B"

class C
end
end

p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"

# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0...

Module#inspect -> String (43.0)

モジュールやクラスの名前を文字列で返します。

...t[例][ruby]{
module
A
module
B
end

p B.name #=> "A::B"

class C
end
end

p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"

# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0...

Module#name -> String | nil (43.0)

モジュールやクラスの名前を文字列で返します。

...t[例][ruby]{
module
A
module
B
end

p B.name #=> "A::B"

class C
end
end

p A.name #=> "A"
p A::B.name #=> "A::B"
p A::C.name #=> "A::C"

# 名前のないモジュール / クラス
p Module.new.name #=> nil
p Class.new.name #=> nil
p Module.new.to_s #=> "#<Module:0x00007f90b0...