るりまサーチ

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

別のキーワード

  1. argf.class each
  2. argf.class each_line
  3. argf.class lines
  4. argf.class to_a
  5. argf.class gets

検索結果

Gem::Ext::Builder.class_name -> String (18202.0)

@todo

@todo

ビルダーのクラス名を返します。

Object#define_singleton_method(symbol) { ... } -> Symbol (18.0)

self に特異メソッド name を定義します。

... String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name...
...to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}...

Object#define_singleton_method(symbol, method) -> Symbol (18.0)

self に特異メソッド name を定義します。

... String または Symbol で指定します。

@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。

@return メソッド名を表す Symbol を返します。

//emlist[][ruby]{
class A
class << self
def class_name...
...to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"

guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}...