ライブラリ
- ビルトイン (638)
-
cgi
/ core (36) - csv (24)
- dbm (48)
- delegate (12)
- erb (12)
- gdbm (48)
- ipaddr (24)
-
irb
/ ext / math-mode (4) - matrix (24)
-
minitest
/ spec (1) -
minitest
/ unit (2) - mkmf (84)
- pathname (51)
- rake (24)
-
rake
/ packagetask (12) -
rdoc
/ context (48) -
rdoc
/ text (12) -
rexml
/ document (12) -
rexml
/ parsers / sax2parser (60) -
rexml
/ streamlistener (12) -
rubygems
/ version (12) - sdbm (48)
- set (23)
- socket (12)
- tsort (93)
-
webrick
/ httpresponse (60) -
webrick
/ httpserver (24) - win32ole (36)
クラス
- Array (12)
-
CSV
:: Row (24) - DBM (48)
- Delegator (12)
- ERB (12)
- GDBM (48)
-
Gem
:: Version (12) - Hash (48)
- IPAddr (24)
-
IRB
:: Context (4) - Method (24)
- Module (264)
- Object (121)
- Pathname (51)
- Proc (6)
-
RDoc
:: Context (48) -
RDoc
:: Options (24) -
REXML
:: AttlistDecl (12) -
REXML
:: Parsers :: SAX2Parser (60) -
Rake
:: FileList (24) -
Rake
:: PackageTask (12) - Range (55)
- Refinement (4)
- SDBM (48)
- Set (32)
- Socket (12)
- String (12)
- TracePoint (12)
- UnboundMethod (12)
- Vector (24)
-
WEBrick
:: HTTPResponse (60) -
WEBrick
:: HTTPServer (24) - WIN32OLE (36)
モジュール
-
CGI
:: QueryExtension (36) - Enumerable (48)
- GC (12)
- Kernel (84)
-
MiniTest
:: Assertions (2) -
RDoc
:: Text (12) -
REXML
:: StreamListener (12) - TSort (93)
キーワード
- < (12)
- <= (12)
- <=> (12)
- === (32)
- > (12)
- >= (12)
-
_ getproperty (12) -
_ invoke (12) -
_ setproperty (12) -
add
_ include (12) -
add
_ to (12) - ancestors (12)
-
append
_ features (12) -
assert
_ includes (1) -
assert
_ send (1) - bind (12)
- body= (12)
- chunked= (12)
-
connect
_ nonblock (12) -
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
-
content
_ length (12) -
content
_ length= (12) - cover? (19)
-
def
_ module (12) -
defined
_ class (12) -
dir
_ config (12) - each (24)
-
each
_ child (24) -
each
_ entry (39) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
enable
_ config (24) - entitydecl (12)
- entries (12)
- eql? (12)
- extend (12)
-
garbage
_ collect (12) -
has
_ key? (60) - header? (12)
-
import
_ methods (4) - include? (168)
-
include
_ line _ numbers (12) - included (12)
-
included
_ modules (12) - includes (12)
-
initialize
_ methods _ etc (12) - inspect (12)
-
is
_ a? (12) - key? (60)
-
kind
_ of? (12) - listen (60)
- markup (12)
-
math
_ mode= (4) - member? (84)
-
method
_ defined? (12) - methods (12)
- mount (12)
-
must
_ include (1) -
package
_ files (12) -
prepend
_ features (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
private
_ methods (12) -
protected
_ method _ defined? (12) -
protected
_ methods (12) -
public
_ method _ defined? (12) -
public
_ methods (12) -
rdoc
_ include (12) - resolve (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (24) -
ruby2
_ keywords (18) -
singleton
_ methods (12) -
strongly
_ connected _ components (12) -
to
_ s (24) -
try
_ cpp (24) - tsort (12)
-
tsort
_ each (23) -
virtual
_ host (12) -
with
_ config (24)
検索結果
先頭5件
-
Object
# respond _ to?(name , include _ all = false) -> bool (120.0) -
オブジェクトがメソッド name を持つとき真を返します。
...o_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。
@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。......mentedError.new
end
def finish
puts "finish"
end
end
class ImplTemplateMethod
include Template
def template_method
"implement template_method"
end
end
class NotImplTemplateMethod
include Template
# not implement template_method
end
puts ImplTemplateMethod.new.respond_to?... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (114.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
...した場合にこのメソッドも
override されるべきです。
false を返します。
@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます
//emlist[例][ruby]{
class Sample
def method_missing(name, *args)......[name, *args] # => [:to_sample, "sample args1", "sample args2"]
return
else
super
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) # =... -
Delegator
# respond _ to _ missing?(m , include _ private) -> bool (108.0) -
@param m メソッド名を指定します。
...@param m メソッド名を指定します。
@param include_private 真を指定すると private メソッドも調べます。... -
Object
# methods(include _ inherited = true) -> [Symbol] (108.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...の名前を返します。
ただし特別に、引数が偽の時は Object#singleton_methods(false) と同じになっています。
@param include_inherited 引数が偽の時は Object#singleton_methods(false) と同じになります。
//emlist[例1][ruby]{
class Parent
private; def... -
Object
# private _ methods(include _ inherited = true) -> [Symbol] (108.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
...そのオブジェクトが理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,O... -
Object
# protected _ methods(include _ inherited = true) -> [Symbol] (108.0) -
そのオブジェクトが理解できる protected メソッド名の一覧を返します。
...そのオブジェクトが理解できる protected メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#protected_instance_methods,Object#metho... -
Object
# public _ methods(include _ inherited = true) -> [Symbol] (108.0) -
そのオブジェクトが理解できる public メソッド名の一覧を返します。
...そのオブジェクトが理解できる public メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#public_instance_methods,Object#methods,Obj... -
Range
# cover?(obj) -> bool (73.0) -
obj が範囲内に含まれている時に true を返します。
...します。
Range#include? と異なり <=> メソッドによる演算により範囲内かどうかを判定します。
Range#include? は原則として離散値を扱い、
Range#cover? は連続値を扱います。
(数値については、例外として Range#include? も連続的に扱......指定します。
//emlist[数値は連続的に扱われているため、 include? / cover? が同じ結果を返す][ruby]{
(1.1..2.3).include?(1.0) # => false
(1.1..2.3).include?(1.1) # => true
(1.1..2.3).include?(1.555) # => true
(1.1..2.3).cover?(1.0) # => false
(1.1..2.3).cover?......の例][ruby]{
('b'..'d').include?('d') # => true
('b'..'d').include?('ba') # => false
('b'..'d').cover?('d') # => true
('b'..'d').cover?('ba') # => true
//}
//emlist[Date, DateTime の例][ruby]{
require 'date'
(Date.today - 365 .. Date.today + 365).include?(Date.today) #=> true... -
Kernel
# dir _ config(target , idefault = nil , ldefault = nil) -> [String , String] (41.0) -
configure オプション --with-TARGET-dir, --with-TARGET-include, --with-TARGET-lib をユーザが extconf.rb に指定できるようにします。
...configure オプション
--with-TARGET-dir,
--with-TARGET-include,
--with-TARGET-lib
をユーザが extconf.rb に指定できるようにします。
--with-TARGET-dir オプションは
システム標準ではない、
ヘッダファイルやライブラリがあるディレクトリをま......"-IPATH/include" を、
$LDFLAGS に "-LPATH/lib" を、
それぞれ追加します。
--with-TARGET-include オプションは
システム標準ではないヘッダファイルのディレクトリを指定するために使います。
ユーザが extconf.rb に --with-TARGET-include=PATH......ldefault システム標準ではないライブラリのディレクトリのデフォルト値を指定します。
例
require 'mkmf'
# xml2 の configure オプションを指定できるようにします。
xml2_dirs = dir_config('xml2', '/opt/local/include/libxml2', '/opt/local/lib')... -
Range
# ===(obj) -> bool (37.0) -
始端と終端の中に obj があるとき、true を返します。 そうでないとき、false を返します。
...n 0...60 then puts "low"
when 60...80 then puts "medium" # => medium
when 80..100 then puts "high"
end
//}
2.5 以前は、単純に Range#include? メソッドを内部で呼んでいました。
しかし、2.6 以降では、(文字列を除いて) Range#cover? と同様の処理をす......e'
p (Date.today - 100...Date.today + 100).include?(DateTime.now) #=> false
p (Date.today - 100...Date.today + 100).cover?(DateTime.now) #=> true
p (Date.today - 100...Date.today + 100) === DateTime.now #=> true
# 2.5 以前は、=== は、include? と同じく比較できず false を返......//emlist[例][ruby]{
p ('a'..'z').include? 'at' #=> false
p ('a'..'z').cover? 'at' #=> true
p ('a'..'z') === 'at' #=> true
# 2.6 以前は、=== は、include? と同じく比較できず false を返していました。
//}
@see d:spec/control#case
@see Range#include?, Range#cover?...