1861件ヒット
[1-100件を表示]
(0.128秒)
ライブラリ
- ビルトイン (1128)
- date (12)
- delegate (156)
-
irb
/ context (12) - json (108)
- matrix (24)
-
minitest
/ spec (1) -
net
/ imap (36) - openssl (36)
- optparse (36)
- pathname (24)
- prime (72)
-
rdoc
/ code _ object (12) -
rdoc
/ markup (12) -
rexml
/ document (72) -
rinda
/ rinda (12) -
ripper
/ filter (24) - shell (12)
-
webrick
/ httpauth / authenticator (12) - win32ole (24)
-
yaml
/ dbm (36)
クラス
-
ARGF
. class (72) - Array (127)
- Class (12)
- Data (12)
- Date (12)
- Delegator (120)
- Enumerator (156)
-
Enumerator
:: Chain (21) -
Enumerator
:: Lazy (60) -
Enumerator
:: Yielder (24) - Hash (63)
-
IRB
:: Context (12) -
JSON
:: State (72) - MatchData (12)
- Matrix (24)
- Module (57)
-
Net
:: IMAP :: FetchData (12) -
Net
:: IMAP :: ResponseCode (12) -
Net
:: IMAP :: UntaggedResponse (12) - Object (100)
-
OpenSSL
:: ASN1 :: ASN1Data (12) -
OpenSSL
:: X509 :: Attribute (24) - OptionParser (36)
- Pathname (24)
- Prime (24)
-
Prime
:: PseudoPrimeGenerator (48) -
RDoc
:: CodeObject (12) -
RDoc
:: Markup (12) -
REXML
:: Attribute (12) -
REXML
:: Elements (24) -
REXML
:: Parent (36) - Random (36)
- Range (12)
- Rational (12)
- Regexp (24)
-
Rinda
:: DRbObjectTemplate (12) -
Ripper
:: Filter (24) - Shell (12)
- SimpleDelegator (24)
- StopIteration (12)
- String (33)
- Struct (31)
-
WIN32OLE
_ TYPELIB (24) -
YAML
:: DBM (36)
モジュール
キーワード
- << (12)
- <=> (12)
- == (3)
- === (12)
- DelegateClass (12)
- [] (60)
-
_ _ getobj _ _ (24) -
_ _ setobj _ _ (24) - allocate (12)
- attr (12)
- bsearch (24)
-
cofactor
_ expansion (12) - collect (36)
-
const
_ source _ location (12) - convert (12)
- cycle (12)
- data (24)
- deconstruct (3)
-
delete
_ at (12) -
delete
_ if (12) -
deprecate
_ constant (12) - detect (12)
- each (146)
-
each
_ byte (12) -
each
_ char (12) -
each
_ child (12) -
each
_ line (24) -
each
_ with _ object (12) -
enum
_ for (48) - eql? (3)
- evaluate (12)
- feed (12)
-
fetch
_ values (20) - filter (21)
-
filter
_ map (6) - find (12)
-
find
_ all (12) - force (12)
- freeze (12)
- generate (12)
- grep (24)
-
grep
_ v (24) - hash (15)
- index (7)
- inject (12)
- key (12)
-
laplace
_ expansion (12) - logger (12)
- map (24)
-
marshal
_ dump (12) -
marshal
_ load (12) - match (48)
-
max
_ by (24) -
method
_ missing (12) - methods (12)
-
min
_ by (24) -
minmax
_ by (12) -
must
_ match (1) - next (12)
-
next
_ values (12) -
object
_ nl (12) -
object
_ nl= (12) - oid (12)
- oid= (12)
- on (36)
-
on
_ XXX (12) -
on
_ default (12) - open (24)
- partition (12)
- path (12)
- peek (12)
-
peek
_ values (12) -
private
_ constant (9) -
private
_ instance _ methods (12) -
private
_ methods (12) -
protected
_ methods (12) -
public
_ methods (12) - pushd (6)
- pushdir (6)
- rand (36)
- reject (24)
-
remove
_ const (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - result (12)
- rewind (7)
- select (60)
-
sort
_ by (12) - string (12)
- then (7)
-
to
_ enum (48) -
to
_ h (12) -
to
_ hash (12) -
to
_ json (12) -
to
_ json _ raw (12) -
to
_ json _ raw _ object (12) -
to
_ regexp (12) - unpack1 (9)
- value (12)
-
values
_ at (36) - version (12)
-
with
_ index (24) -
with
_ object (48) - write (12)
- yield (12)
-
yield
_ self (8)
検索結果
先頭5件
-
Object
# private _ methods(include _ inherited = true) -> [Symbol] (27113.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
...が理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,Object#singleton_methods... -
Object
# must _ match(regexp) -> true (27101.0) -
自身が与えられた正規表現にマッチした場合、検査にパスしたことになります。
...文字列を指定した場合は文字列そのものにマッチする
正規表現に変換してから使用します。
@raise MiniTest::Assertion 自身が与えられた正規表現にマッチしなかった場合に発生します。
@see MiniTest::Assertions#assert_match... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (21113.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
...れるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。
Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。
BasicObject#method_missing を override した......このメソッドも
override されるべきです。
false を返します。
@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます
//emlist[例][ruby]{
class Sample
def method_missing(name, *args)
if name =~ /^to......end
end
def respond_to_missing?(sym, include_private)
(sym =~ /^to_*/) ? true : super
end
end
s = Sample.new
s.to_sample("sample args1", "sample args2")
s.respond_to?(:to_sample) # => true
s.respond_to?(:sample) # => false
//}
@see Object#respond_to?, BasicObject#method_missing... -
Object
# then -> Enumerator (21109.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...s).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件にあうので何もしない
1.yie... -
Object
# yield _ self -> Enumerator (21109.0) -
self を引数としてブロックを評価し、ブロックの結果を返します。
...s).
yield_self {|url| URI(url).read }.
yield_self {|response| JSON.parse(response) }
//}
ブロックなしで呼び出されたときは Enumerator を返します。
例えば条件によって値を捨てるのに使えます。
//emlist[][ruby]{
# 条件にあうので何もしない
1.yie... -
Object
# enum _ for(method = :each , *args) -> Enumerator (21101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method_......each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}
@see Enumerator, Enumerator#size... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (21101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method_......each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}
@see Enumerator, Enumerator#size... -
Object
# to _ enum(method = :each , *args) -> Enumerator (21101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method_......each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}
@see Enumerator, Enumerator#size... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (21101.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......2, 3]
p(a.to_enum) #=> #<Enumerator: [1, 2, 3]:each>
//}
//emlist[例(ブロックを指定する場合)][ruby]{
module Enumerable
def repeat(n)
raise ArgumentError, "#{n} is negative!" if n < 0
unless block_given?
# __method__ はここでは :repeat
return to_enum(__method_......each do |*val|
n.times { yield *val }
end
end
end
%i[hello world].repeat(2) { |w| puts w }
# => 'hello', 'hello', 'world', 'world'
enum = (1..14).repeat(3)
# => #<Enumerator: 1..14:repeat(3)>
enum.first(4) # => [1, 1, 1, 2]
enum.size # => 42
//}
@see Enumerator, Enumerator#size... -
Object
# to _ regexp -> Regexp (21019.0) -
オブジェクトの Regexp への暗黙の変換が必要なときに内部で呼ばれます。 デフォルトでは定義されていません。
...。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。
このメソッドを定義する......ての場面で代置可能であるような、
* 正規表現そのものとみなせるようなもの
という厳しいものになっています。
//emlist[][ruby]{
class Foo
def to_regexp
/[\d]+/
end
end
it = Foo.new
p Regexp.union(/^at/, it) #=> /(?-mix:^at)|(?-mix:[\d]+)/
//}...