192件ヒット
[1-100件を表示]
(0.061秒)
別のキーワード
種類
- インスタンスメソッド (165)
- 文書 (27)
ライブラリ
- ビルトイン (165)
クラス
- Module (44)
- Object (33)
- UnboundMethod (88)
キーワード
- == (11)
-
NEWS for Ruby 2
. 7 . 0 (5) - arity (11)
- clone (11)
-
define
_ method (22) - eql? (11)
- inspect (11)
- method (11)
- name (11)
-
public
_ instance _ method (11) -
public
_ method (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 4 feature (11) -
singleton
_ method (11) -
source
_ location (11) -
to
_ s (11)
検索結果
先頭5件
-
Module
# instance _ method(name) -> UnboundMethod (18149.0) -
self のインスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...od を返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError self に存在しないメソッドを指定した場合に発生します。
@see Module#public_instance_method, Object#method
//emlist[例][ruby]{
class Interpreter
def do_a()......end
def do_v() print "Dave"; end
Dispatcher = {
"a" => instance_method(:do_a),
"d" => instance_method(:do_d),
"e" => instance_method(:do_e),
"v" => instance_method(:do_v)
}
def interpret(string)
string.each_char {|b| Dispatcher[b].bind(self).call }
end
end
interpr... -
Module
# public _ instance _ method(name) -> UnboundMethod (6125.0) -
self の public インスタンスメソッド name をオブジェクト化した UnboundMethod を返します。
...名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引数として与えると発生します。
//emlist[例][ruby]{
Kernel.public_instance_method(:object_id) #=> #<Unbou......ndMethod: Kernel#object_id>
Kernel.public_instance_method(:p) # method `p' for module `Kernel' is private (NameError)
//}
@see Module#instance_method,Object#public_method... -
ruby 1
. 6 feature (312.0) -
ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。
...りました。
p "#{ "" }"
=> ruby 1.6.7 (2002-03-01) [i586-linux]
""
=> -:1: warning: bad substitution in string
ruby 1.6.7 (2002-09-12) [i586-linux]
"#{ }"
=> ruby 1.6.7 (2002-09-25) [i586-linux]
""
これは1.7......ません。1.6に入るかも不明です。-))
: 2002-07-11 String#slice!
範囲外の文字列を指定したときに例外を返す場合がありましたが、常に nil
を返すようになりました。(String#[]やString#slice と同じ結果を返すと
いうことです)......((<ruby-dev:14942>))
Module.constants.each {|c|
c = eval c
if c.instance_of?(Class)
p c
c.instance_methods.each {|m|
c.module_eval "undef #{m};"
}
c.module_eval {undef initialize}
end
}... -
UnboundMethod
# inspect -> String (120.0) -
self を読みやすい文字列として返します。
...self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect... -
UnboundMethod
# to _ s -> String (120.0) -
self を読みやすい文字列として返します。
...self を読みやすい文字列として返します。
詳しくは Method#inspect を参照してください。
//emlist[例][ruby]{
String.instance_method(:count).inspect # => "#<UnboundMethod: String#count>"
//}
@see Method#inspect... -
UnboundMethod
# source _ location -> [String , Integer] | nil (113.0) -
ソースコードのファイル名と行番号を配列で返します。
...(つまりネイティブ
である)場合は nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
//}
@see Pro... -
ruby 1
. 8 . 4 feature (96.0) -
ruby 1.8.4 feature ruby 1.8.4 での ruby 1.8.3 からの変更点です。
...e (Win全般) [bug]>))
* ((<ruby 1.8.4 feature/File::Stat#pipe? [bug]>))
* ((<ruby 1.8.4 feature/Array#fill [bug]>))
* ((<ruby 1.8.4 feature/String#scan [bug]>))
* ((<ruby 1.8.4 feature/File.join [bug]>))
* ((<ruby 1.8.4 feature/Thread#pass [bug]>))
* ((<ruby 1.8.4 feature/Module#const_m......y 1.8.4 feature/WEBrick::Config::FileHandler [compat]>))
* ((<ruby 1.8.4 feature/WEBrick>))
* ((<ruby 1.8.4 feature/WEBrick::HTTPRequest#query_string= [new]>))
* ((<ruby 1.8.4 feature/Readline [bug]>))
* ((<ruby 1.8.4 feature/Syck [bug]>))
* ((<ruby 1.8.4 feature/irb [bug]>))
* ((<ruby 1......def initialize
super
end
end
class Bar
include Foo
def initialize
Foo.instance_method(:initialize).bind(self).call
end
end
Bar.new
# => ruby 1.8.3 (2005-09-21) [i686-linux]
-:3:i... -
UnboundMethod
# arity -> Integer (84.0) -
メソッドが受け付ける引数の数を返します。
...end
end
p C.instance_method(:one).arity #=> 0
p C.instance_method(:two).arity #=> 1
p C.instance_method(:three).arity #=> -1
p C.instance_method(:four).arity #=> 2
p C.instance_method(:five).arity #=> -3
p C.instance_method(:six).arity #=> -3
String.instance_method(:size).arit......y #=> 0
String.instance_method(:replace).arity #=> 1
String.instance_method(:squeeze).arity #=> -1
String.instance_method(:count).arity #=> -1
//}... -
NEWS for Ruby 2
. 7 . 0 (72.0) -
NEWS for Ruby 2.7.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。
...)
where(sales: ..100)
//}
* 「$;」にnil以外の値を設定すると警告が出るようになりました。 14240
nil以外の時はString#splitで参照した時も警告が出ます。
この警告は「-W:no-deprecated」オプションで止められます。
* 「$,」にn......by 3.0 では verbose モードでなくても表示され、Ruby 3.2 で削除される
予定です。 16131
* Object#methodとModule#instance_methodがrefinementsを考慮するようになりました。 15373
=== コマンドラインオプション
==== 警告オプション
カテ......同じModuleは常に同じStringを返します。
この変更は実験的です。 16150
* NilClass / TrueClass / FalseClass
* 変更されたメソッド
* NilClass#to_s, TrueClass#to_s, FalseClass#to_sが
常にfreezeされたStringを返すようになりまし... -
UnboundMethod
# ==(other) -> bool (30.0) -
自身と other が同じクラスあるいは同じモジュールの同じメソッドを表す場合に true を返します。そうでない場合に false を返します。
...@param other 自身と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = String.instance_method(:size)
p a == b #=> true
c = Array.instance_method(:size)
p a == c #=> false
//}...