4088件ヒット
[1-100件を表示]
(0.056秒)
別のキーワード
ライブラリ
- ビルトイン (2044)
-
cgi
/ core (24) -
cgi
/ html (96) - delegate (48)
- drb (12)
- erb (48)
- fileutils (24)
- forwardable (96)
-
irb
/ cmd / help (12) -
irb
/ context (24) -
irb
/ extend-command (12) -
irb
/ input-method (216) -
irb
/ output-method (60) - json (168)
-
minitest
/ spec (1) -
minitest
/ unit (3) -
net
/ http (24) -
net
/ imap (24) - objspace (12)
- openssl (156)
- ostruct (12)
- pp (12)
- profiler (6)
- psych (8)
- rake (36)
- rdoc (12)
-
rdoc
/ code _ object (12) -
rdoc
/ context (72) -
rdoc
/ stats (12) -
rdoc
/ top _ level (12) -
shell
/ command-processor (6) -
webrick
/ cgi (12) -
webrick
/ httprequest (12) -
webrick
/ httpresponse (12) -
webrick
/ httpservlet / abstract (12) - win32ole (528)
クラス
- Array (10)
- BasicObject (72)
- CGI (12)
-
DRb
:: DRbServer (12) - Delegator (48)
- ERB (36)
- Enumerator (62)
-
Enumerator
:: Lazy (48) - Exception (12)
-
IRB
:: Context (24) -
IRB
:: ExtendCommand :: Help (12) -
IRB
:: FileInputMethod (36) -
IRB
:: InputMethod (36) -
IRB
:: OutputMethod (48) -
IRB
:: ReadlineInputMethod (72) -
IRB
:: StdioInputMethod (72) -
IRB
:: StdioOutputMethod (12) -
JSON
:: State (24) - Method (271)
-
MiniTest
:: Unit (1) -
MiniTest
:: Unit :: TestCase (1) - Module (500)
- NameError (24)
-
Net
:: HTTPGenericRequest (12) -
Net
:: IMAP (24) - NoMethodError (40)
- Object (217)
-
OpenSSL
:: Engine (108) -
OpenSSL
:: SSL :: SSLContext (48) - PP (12)
- Proc (56)
-
RDoc
:: CodeObject (12) -
RDoc
:: Context (72) -
RDoc
:: Stats (12) -
RDoc
:: TopLevel (12) -
Rake
:: FileList (24) - Refinement (4)
- Regexp (48)
-
RubyVM
:: InstructionSequence (108) -
Shell
:: CommandProcessor (6) - String (60)
- Thread (12)
- TracePoint (43)
- UnboundMethod (179)
-
WEBrick
:: CGI (12) -
WEBrick
:: HTTPRequest (12) -
WEBrick
:: HTTPResponse (12) -
WEBrick
:: HTTPServlet :: AbstractServlet (12) - WIN32OLE (144)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (228) -
WIN32OLE
_ PARAM (120) -
WIN32OLE
_ TYPE (24)
モジュール
-
CGI
:: HtmlExtension (96) -
CGI
:: QueryExtension (12) -
ERB
:: DefMethod (12) - FileUtils (24)
- Forwardable (48)
-
IRB
:: ExtendCommandBundle (12) -
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (36) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (205)
- Marshal (24)
-
MiniTest
:: Assertions (1) -
Net
:: HTTPHeader (12) - ObjectSpace (12)
- RDoc (12)
-
RubyVM
:: AbstractSyntaxTree (10) - SingleForwardable (48)
オブジェクト
- main (24)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - << (14)
- == (24)
- === (8)
- >> (14)
-
ARRAY
_ METHODS (12) -
DELEGATING
_ METHODS (12) -
INSECURE
_ METHOD (12) - METHODS (24)
-
METHOD
_ ALL (12) -
METHOD
_ CIPHERS (12) -
METHOD
_ DH (12) -
METHOD
_ DIGESTS (12) -
METHOD
_ DSA (12) -
METHOD
_ MODIFIERS (12) -
METHOD
_ NONE (12) -
METHOD
_ RAND (12) -
METHOD
_ RSA (12) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 3
. 0 . 0 (5) - NoDelegateMethods (6)
- NoMethodError (12)
- Numeric (12)
- OpenStruct (12)
-
Profiler
_ _ (6) - Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- [] (36)
-
_ _ callee _ _ (12) -
_ _ method _ _ (12) -
_ getproperty (12) -
_ invoke (12) -
_ setproperty (12) -
absolute
_ path (12) -
add
_ method (12) -
add
_ response _ handler (24) -
add
_ to (12) -
alias
_ method (12) - args (12)
- arity (24)
-
assert
_ respond _ to (1) - backtrace (12)
-
base
_ label (12) - bind (12)
-
bind
_ call (12) - call (24)
-
callee
_ id (12) - caller (36)
- cgi (12)
-
cgi
/ session (12) -
class
_ exec (12) - clone (24)
-
collect
_ method (12) -
count
_ nodes (12) - curry (22)
- debug (12)
-
def
_ class (12) -
def
_ delegator (24) -
def
_ delegators (24) -
def
_ erb _ method (12) -
def
_ instance _ delegator (12) -
def
_ instance _ delegators (12) -
def
_ method (12) -
def
_ module (12) -
def
_ single _ delegator (12) -
def
_ single _ delegators (12) - default (12)
-
default
_ event _ sources (12) -
define
_ method (48) -
define
_ singleton _ method (24) - dig (10)
- disasm (12)
- disassemble (12)
- dispid (12)
- dump (24)
- each (48)
-
each
_ method (12) - encode (36)
- encoding (36)
-
enum
_ for (48) - eof? (24)
- eql? (24)
- eval (24)
- event? (12)
-
event
_ interface (12) - execute (12)
- fail (36)
-
file
_ name (12) -
find
_ local _ symbol (12) -
first
_ lineno (12) - form (48)
- generate (12)
- gets (36)
- handler= (12)
- hash (24)
- header (12)
- helpcontext (12)
- helpfile (12)
- helpstring (12)
-
import
_ methods (4) -
initialize
_ methods _ etc (12) - input? (12)
- inspect (24)
-
instance
_ eval (24) -
instance
_ method (12) -
instance
_ methods (12) - invkind (12)
-
invoke
_ kind (12) - io (12)
- irb (12)
-
irb
/ completion (12) -
irb
_ original _ method _ name (12) -
json
_ create (12) - label (12)
- lambda (18)
- lambda? (12)
-
last
_ match (24) - line (24)
- match (24)
- method (36)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ list (12) -
method
_ missing (36) -
method
_ removed (12) -
method
_ undefined (12) - methods (24)
-
module
_ exec (12) -
module
_ function (36) -
multipart
_ form (48) -
must
_ respond _ to (1) - name (60)
- new (153)
-
num
_ methods (12) - of (22)
-
offset
_ vtbl (12) -
ole
_ activex _ initialize (12) -
ole
_ func _ methods (12) -
ole
_ get _ methods (12) -
ole
_ method (12) -
ole
_ method _ help (12) -
ole
_ methods (24) -
ole
_ put _ methods (12) -
ole
_ show _ help (12) -
ole
_ type (12) -
ole
_ type _ detail (12) - optional? (12)
-
original
_ name (24) - output? (12)
- owner (24)
- parameters (43)
- params (12)
- path (12)
- pp (12)
- ppx (12)
- print (12)
- printn (12)
- private (48)
-
private
_ call? (9) -
private
_ class _ method (24) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
private
_ methods (12) - proc (19)
- protected (48)
-
protected
_ instance _ methods (12) -
protected
_ method _ defined? (12) -
protected
_ methods (24) -
psych
_ yaml _ as (4) - public (48)
-
public
_ class _ method (24) -
public
_ instance _ method (12) -
public
_ instance _ methods (12) -
public
_ method (12) -
public
_ method _ defined? (12) -
public
_ methods (24) - puke (1)
- puts (12)
- raise (36)
-
rake
_ extension (12) - rdoc (12)
-
readable
_ atfer _ eof? (36) - receiver (12)
-
remove
_ method (12) -
remove
_ methods _ etc (12) -
renegotiation
_ cb= (12) -
request
_ method (36) -
require
_ relative (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) -
return
_ type (12) -
return
_ type _ detail (12) -
return
_ vtype (12) - retval? (12)
-
rexml
/ parsers / sax2parser (12) -
rexml
/ parsers / streamparser (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby2
_ keywords (18) - send (24)
- seplist (12)
- service (24)
-
set
_ default (12) -
set
_ visibility _ for (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
size
_ opt _ params (12) -
size
_ params (12) -
source
_ location (36) -
super
_ method (22) -
test
_ methods (1) -
to
_ a (12) -
to
_ enum (48) -
to
_ json (108) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ proc (12) -
to
_ s (72) -
to
_ str (12) - unbind (12)
-
undef
_ method (12) - visible? (12)
- xmlrpc (3)
-
yaml
_ as (4) - クラス/メソッドの定義 (12)
- 制御構造 (12)
検索結果
先頭5件
-
Method (38100.0)
-
Object#method によりオブジェクト化され たメソッドオブジェクトのクラスです。
...ject#method によりオブジェクト化され
たメソッドオブジェクトのクラスです。
メソッドの実体(名前でなく)とレシーバの組を封入します。
Proc オブジェクトと違ってコンテキストを保持しません。
=== Proc との差
Method は......は使い捨てに向き、Method は何度も繰り返し生成する
場合に向くと言えます。また内包するコードの大きさという点では
Proc は小規模、Method は大規模コードに向くと言えます。
既存のメソッドを Method オブジェクト化する......oo.new.method(:foo)
p m # => #<Method: Foo#foo>
p m.call(1) # => "foo called with arg 1"
//}
名前のないメソッド(の代わり)が必要なら Proc を使うと良い。
//emlist[例][ruby]{
pr = Proc.new {|arg|
"proc called with arg #{arg}"
}
p pr # => #<Proc... -
Method
# super _ method -> Method | nil (27390.0) -
self 内で super を実行した際に実行されるメソッドを Method オブジェ クトにして返します。
...ドを Method オブジェ
クトにして返します。
@see UnboundMethod#super_method
//emlist[例][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 # => "subclas......s method"
m.super_method # => #<Method: Super#foo>
m.super_method.call # => "superclass method"
//}... -
Method
# >>(callable) -> Proc (27136.0) -
self と引数を合成した Proc を返します。
...
Method#<< とは呼び出しの順序が逆になります。
@param callable Proc、Method、もしくは任意の call メソッドを持ったオブジェクト。
//emlist[例][ruby]{
def f(x)
x * x
end
def g(x)
x + x
end
# (3 * 3) + (3 * 3)
p (method(:f) >> method(:g)).call(3) # => 18......uby]{
class WordScanner
def self.call(str)
str.scan(/\w+/)
end
end
File.write('testfile', <<~TEXT)
Hello, World!
Hello, Ruby!
TEXT
pipeline = File.method(:read) >> WordScanner >> method(:pp)
pipeline.call('testfile') # => ["Hello", "World", "Hello", "Ruby"]
//}
@see Proc#<<, Proc#>>... -
Method
# inspect -> String (21298.0) -
self を読みやすい文字列として返します。
...します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジ......klass2 は、実際にそのメソッドを定義しているクラス/モジュール名、
method は、メソッド名を表します。
arg は引数を表します。
「foo.rb:2」は Method#source_location を表します。
source_location が nil の場合には付きません。
//em......r(a, b)
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo() test.rb:2>
p Bar.new.method(:bar) # => #<Method: Bar#bar(a, b) test.rb:8>
//}
klass1 と klass2 が同じ場合は以下の形式になります。
#<Method: klass1#method() foo.rb:2> (形式2)
特... -
Method
# to _ s -> String (21298.0) -
self を読みやすい文字列として返します。
...します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method(arg) foo.rb:2> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジ......klass2 は、実際にそのメソッドを定義しているクラス/モジュール名、
method は、メソッド名を表します。
arg は引数を表します。
「foo.rb:2」は Method#source_location を表します。
source_location が nil の場合には付きません。
//em......r(a, b)
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo() test.rb:2>
p Bar.new.method(:bar) # => #<Method: Bar#bar(a, b) test.rb:8>
//}
klass1 と klass2 が同じ場合は以下の形式になります。
#<Method: klass1#method() foo.rb:2> (形式2)
特... -
Method
# inspect -> String (21292.0) -
self を読みやすい文字列として返します。
...します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュ......ュール名、
method は、メソッド名を表します。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo>
p Bar.new.method(:bar) # => #<Method: Bar#bar>
//}
klass1 と......が同じ場合は以下の形式になります。
#<Method: klass1#method> (形式2)
特異メソッドに対しては、
#<Method: obj.method> (形式3)
#<Method: klass1(klass2).method> (形式4)
という形式の文字列を... -
Method
# to _ s -> String (21292.0) -
self を読みやすい文字列として返します。
...します。
以下の形式の文字列を返します。
#<Method: klass1(klass2)#method> (形式1)
klass1 は、Method#inspect では、レシーバのクラス名、
UnboundMethod#inspect では、UnboundMethod オブジェクトの生成
元となったクラス/モジュ......ュール名、
method は、メソッド名を表します。
//emlist[例][ruby]{
module Foo
def foo
"foo"
end
end
class Bar
include Foo
def bar
end
end
p Bar.new.method(:foo) # => #<Method: Bar(Foo)#foo>
p Bar.new.method(:bar) # => #<Method: Bar#bar>
//}
klass1 と......が同じ場合は以下の形式になります。
#<Method: klass1#method> (形式2)
特異メソッドに対しては、
#<Method: obj.method> (形式3)
#<Method: klass1(klass2).method> (形式4)
という形式の文字列を... -
Method
# unbind -> UnboundMethod (21248.0) -
self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。
...いた UnboundMethod オブ
ジェクトを生成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
unbound_method = m.unbind # => #<UnboundMethod: Foo#foo>
unbound_method.bind(Foo.new) # => #<Method: Foo#foo>
//}... -
Method
# clone -> Method (21247.0) -
自身を複製した Method オブジェクトを作成して返します。
...自身を複製した Method オブジェクトを作成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
m.call # => "foo"
m.clone # => #<Method: Foo#foo>
m.clone.call # => "foo"
//}... -
Method
# arity -> Integer (21160.0) -
メソッドが受け付ける引数の数を返します。
...p c.method(:u).arity #=> 0
p c.method(:v).arity #=> 1
p c.method(:w).arity #=> -1
p c.method(:x).arity #=> 2
p c.method(:y).arity #=> -3
p c.method(:z).arity #=> -3
s = "xyz"
s.method(:size).arity #=> 0
s.method(:replace).arity #=> 1
s.method(:squeeze).arity #=> -1......s.method(:count).arity #=> -1
//}... -
Method
# parameters -> [object] (21140.0) -
Method オブジェクトの引数の情報を返します。
...Method オブジェクトの引数の情報を返します。
Method オブジェクトが引数を取らなければ空の配列を返します。引数を取る場合は、配列の配列を返し、
各配列の要素は引数の種類に応じた以下のような Symbol と、仮引数の名......t[例][ruby]{
m = Class.new{define_method(:m){|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}}.instance_method(:m)
m.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_other], [:block, :b
File.method(:symlink).parameters #=> req
//}
@see Proc#parameters......st[例][ruby]{
m = Class.new{define_method(:m){|x, y=42, *other, k_x:, k_y: 42, **k_other, &b|}}.instance_method(:m)
m.parameters #=> x], [:opt, :y], [:rest, :other], [:keyreq, :k_x], [:key, :k_y], [:keyrest, :k_other], [:block, :b
File.method(:symlink).parameters #=> req
//}
@see Proc#parameters...