別のキーワード
ライブラリ
- ビルトイン (602)
- csv (24)
- erb (12)
- pathname (51)
- rake (12)
-
rake
/ packagetask (12) -
rexml
/ streamlistener (12) -
rubygems
/ version (12) - set (23)
- tsort (93)
クラス
- Array (12)
-
CSV
:: Row (24) - ERB (12)
-
Gem
:: Version (12) - Hash (48)
- Method (24)
- Module (264)
- Object (84)
- Pathname (51)
- Proc (6)
-
Rake
:: FileList (12) -
Rake
:: PackageTask (12) - Range (55)
- Refinement (4)
- Set (32)
- String (12)
- TracePoint (12)
- UnboundMethod (12)
モジュール
- Enumerable (48)
- GC (12)
-
REXML
:: StreamListener (12) - TSort (93)
キーワード
- < (12)
- <= (12)
- <=> (12)
- === (20)
- > (12)
- >= (12)
- ancestors (12)
-
append
_ features (12) - bind (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
- cover? (19)
-
def
_ module (12) -
defined
_ class (12) -
each
_ child (24) -
each
_ entry (39) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) - entitydecl (12)
- entries (12)
- eql? (12)
- extend (12)
-
garbage
_ collect (12) -
has
_ key? (12) - header? (12)
-
import
_ methods (4) - include? (96)
- included (12)
-
included
_ modules (12) - inspect (12)
-
is
_ a? (12) - key? (12)
-
kind
_ of? (12) - member? (48)
-
method
_ defined? (12) - methods (12)
-
package
_ files (12) -
prepend
_ features (12) -
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ method _ defined? (12) - resolve (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) -
ruby2
_ keywords (18) -
singleton
_ methods (12) -
strongly
_ connected _ components (12) -
to
_ s (12) - tsort (12)
-
tsort
_ each (23)
検索結果
先頭5件
-
Set
# include?(o) -> bool (6126.0) -
オブジェクト o がその集合に属する場合に true を返します。
...オブジェクト o がその集合に属する場合に true を返します。
@param o オブジェクトを指定します。
//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}... -
Module
# included _ modules -> [Module] (6119.0) -
self にインクルードされているモジュールの配列を返します。
...self にインクルードされているモジュールの配列を返します。
//emlist[例][ruby]{
module Mixin
end
module Outer
include Mixin
end
Mixin.included_modules #=> []
Outer.included_modules #=> [Mixin]
//}
@see Module#ancestors... -
Range
# include?(obj) -> bool (3138.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...オブジェクトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range... -
Set
# include?(o) -> bool (3126.0) -
オブジェクト o がその集合に属する場合に true を返します。
...オブジェクト o がその集合に属する場合に true を返します。
@param o オブジェクトを指定します。
//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}......オブジェクト o がその集合に属する場合に true を返します。
@param o オブジェクトを指定します。
//emlist[][ruby]{
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}... -
CSV
:: Row # include?(name) -> bool (3114.0) -
自身のヘッダに与えられた値が含まれている場合は真を返します。 そうでない場合は偽を返します。
...い場合は偽を返します。
@param name この行のヘッダに含まれているかどうか調べたい値を指定します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2"], [1, 2])
row.header?("header1") # => true
row.header?("header3") # => false
//}... -
Hash
# include?(key) -> bool (3114.0) -
ハッシュが key をキーとして持つ時真を返します。
...ハッシュが key をキーとして持つ時真を返します。
@param key 探索するキーを指定します。
//emlist[][ruby]{
p({1 => "one"}.key?(1)) # => true
p({1 => "one"}.key?(2)) # => false
//}
@see Hash#value?... -
Range
# member?(obj) -> bool (3038.0) -
obj が範囲内に含まれている時に true を返します。 そうでない場合は、false を返します。
...オブジェクトを指定します。
//emlist[例][ruby]{
p ("a" .. "c").include?("b") # => true
p ("a" .. "c").include?("B") # => false
p ("a" .. "c").include?("ba") # => false
p ("a" .. "c").cover?("ba") # => true
p (1 .. 3).include?(1.5) # => true
//}
@see d:spec/control#case
@see Range... -
Enumerable
# member?(val) -> bool (3026.0) -
val と == の関係にある要素を含むとき真を返します。
...val と == の関係にある要素を含むとき真を返します。
@param val 任意のオブジェクト
//emlist[例][ruby]{
[2, 4, 6].include? 2 #=> true
[2, 4, 6].include? 1 #=> false
[2, 4, 6].member? 2 #=> true
[2, 4, 6].member? 1 #=> false
//}... -
Set
# member?(o) -> bool (3026.0) -
オブジェクト o がその集合に属する場合に true を返します。
...オブジェクト o がその集合に属する場合に true を返します。
@param o オブジェクトを指定します。
//emlist[][ruby]{
require 'set'
set = Set['hello', 'world']
p set.include?('world') # => true
p set.include?('bye') # => false
//}... -
Object
# respond _ to?(name , include _ all = false) -> bool (168.0) -
オブジェクトがメソッド name を持つとき真を返します。
...します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装されているメソッドのみです。
Rubyで実装されたメソッドで NotImplementedError が発生する場合は true......です。
@param include_all private メソッドと protected メソッドを確認の対象に
含めるかを true か false で指定します。省略した場合
は false(含めない) を指定した事になります。
//emlist[][ruby]{
class F
def......thod
include Template
def template_method
"implement template_method"
end
end
class NotImplTemplateMethod
include Template
# not implement template_method
end
puts ImplTemplateMethod.new.respond_to?(:template_method) # => true
# NotImplementedError が発生しているが、Rubyに... -
Object
# methods(include _ inherited = true) -> [Symbol] (132.0) -
そのオブジェクトに対して呼び出せるメソッド名の一覧を返します。 このメソッドは public メソッドおよび protected メソッドの名前を返します。
...が偽の時は Object#singleton_methods(false) と同じになっています。
@param include_inherited 引数が偽の時は Object#singleton_methods(false) と同じになります。
//emlist[例1][ruby]{
class Parent
private; def private_parent() end
protected; def protected_parent......:public_singleton]
[:public_singleton, :public_foo]
[:private_singleton, :private_foo]
[:protected_singleton, :protected_foo]
//}
//emlist[例2][ruby]{
# あるオブジェクトの応答できるメソッドの一覧を得る。
# 自身のクラスの親クラスのインスタンスメソッ... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (126.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
...されるべきです。
false を返します。
@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます
//emlist[例][ruby]{
class Sample
def method_missing(name, *args)
if name =~ /^to_*/
[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) # => true
s.respond_to?(:sa...