1223件ヒット
[1-100件を表示]
(0.100秒)
種類
- インスタンスメソッド (961)
- 定数 (238)
- 特異メソッド (24)
ライブラリ
- ビルトイン (1111)
-
minitest
/ spec (16) - pp (60)
- psych (36)
キーワード
- !~ (12)
- <=> (12)
- == (12)
- === (12)
- =~ (9)
- ARGF (12)
- ARGV (12)
- DATA (12)
- ENV (12)
- FALSE (8)
- NIL (8)
-
RUBY
_ COPYRIGHT (12) -
RUBY
_ DESCRIPTION (12) -
RUBY
_ ENGINE (12) -
RUBY
_ ENGINE _ VERSION (10) -
RUBY
_ PATCHLEVEL (12) -
RUBY
_ PLATFORM (12) -
RUBY
_ RELEASE _ DATE (12) -
RUBY
_ REVISION (12) -
RUBY
_ VERSION (12) -
SCRIPT
_ LINES _ _ (12) - STDERR (12)
- STDIN (12)
- STDOUT (12)
-
TOPLEVEL
_ BINDING (12) - TRUE (8)
-
_ dump (12) - class (12)
- clone (12)
-
define
_ singleton _ method (24) - display (12)
- dup (12)
-
enum
_ for (24) - eql? (12)
- equal? (12)
- extend (12)
- freeze (12)
- frozen? (12)
- hash (12)
- initialize (12)
-
initialize
_ clone (12) -
initialize
_ copy (12) -
initialize
_ dup (12) - inspect (12)
-
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
is
_ a? (12) - itself (12)
-
kind
_ of? (12) -
marshal
_ dump (12) -
marshal
_ load (12) - method (12)
- methods (12)
-
must
_ be (1) -
must
_ be _ close _ to (1) -
must
_ be _ empty (1) -
must
_ be _ instance _ of (1) -
must
_ be _ kind _ of (1) -
must
_ be _ nil (1) -
must
_ be _ same _ as (1) -
must
_ be _ within _ delta (1) -
must
_ be _ within _ epsilon (1) -
must
_ equal (1) -
must
_ include (1) -
must
_ match (1) -
must
_ raise (1) -
must
_ respond _ to (1) -
must
_ send (1) -
must
_ throw (1) - new (12)
- nil? (12)
-
object
_ id (12) -
pretty
_ inspect (12) -
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
pretty
_ print _ inspect (12) -
pretty
_ print _ instance _ variables (12) -
private
_ methods (12) -
protected
_ methods (12) -
psych
_ to _ yaml (12) -
public
_ method (12) -
public
_ methods (12) -
public
_ send (24) -
remove
_ instance _ variable (12) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - send (24)
-
singleton
_ class (12) -
singleton
_ method (12) -
singleton
_ methods (12) - taint (9)
- tainted? (9)
- tap (12)
- then (14)
-
to
_ a (12) -
to
_ ary (12) -
to
_ enum (24) -
to
_ hash (12) -
to
_ int (12) -
to
_ io (12) -
to
_ proc (12) -
to
_ regexp (12) -
to
_ s (12) -
to
_ str (12) -
to
_ yaml (12) - trust (9)
- untaint (9)
- untrust (9)
- untrusted? (9)
-
yaml
_ tag (12) -
yield
_ self (16)
検索結果
先頭5件
-
Object
# protected _ methods(include _ inherited = true) -> [Symbol] (9301.0) -
そのオブジェクトが理解できる protected メソッド名の一覧を返します。
...解できる protected メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#protected_instance_methods,Object#methods,Object#singleton_methods... -
Object
# method(name) -> Method (6201.0) -
オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。
...た
Method オブジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
me = -365.method(:abs)
p me #=> #<Method: Integer#abs......>
p me.call #=> 365
//}
@see Module#instance_method, Method, BasicObject#__send__, Object#send, Kernel.#eval, Object#singleton_method... -
Object
# private _ methods(include _ inherited = true) -> [Symbol] (6201.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
...が理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,Object#singleton_methods... -
Object
# public _ method(name) -> Method (6201.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
...thod オブジェクトを返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引数として与えると発生します。
//emlist......[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method `p' for class `Integer' is private (NameError)
//}
@see Object#method,Object#public_send,Module#public_instance_method... -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (6201.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
...されている特異メソッド名
(public あるいは protected メソッド) の一覧を返します。
inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッドや、
self......ton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メソッドを含める場合は真を、
そうでない場合は偽を指定します。
//emlist[例1][ruby]{
Parent = Class.new
class <<Parent
private; def privat......s_parent() end
protected; def protected_class_parent() end
public; def public_class_parent() end
end
Foo = Class.new(Parent)
class <<Foo
private; def private_class_foo() end
protected; def protected_class_foo() end
public; def public_class_foo() end
end
module Bar
private; d... -
Object
# to _ enum(method = :each , *args) -> Enumerator (6201.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 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__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (6201.0) -
Enumerator.new(self, method, *args) を返します。
...Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出......渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
# protects an array from being modified
a = [1, 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__, n) do
# size メソッドが nil でなければ size * n を返す。
sz = size... -
Object
. yaml _ tag(tag) -> () (6201.0) -
クラスと tag の間を関連付けます。
...クラスと tag の間を関連付けます。
これによって tag 付けされた YAML ドキュメントを Ruby のオブジェクトに
変換したりその逆をしたりすることができます。
@param tag 対象のクラスに関連付けるタグの文字列
=== Example
requir......Foo
def initialize(x)
@x = x
end
attr_reader :x
end
# Dumps Ruby object normally
p Psych.dump(Foo.new(3))
# =>
# --- !ruby/object:Foo
# x: 3
# Registers tag with class Foo
Foo.yaml_as("tag:example.com,2013:foo")
# ... and dumps the object of Foo class......Psych.dump(Foo.new(3), STDOUT)
# =>
# --- !<tag:example.com,2013:foo>
# x: 3
# Loads the object from the tagged YAML node
p Psych.load(<<EOS)
--- !<tag:example.com,2012:foo>
x: 8
EOS
# => #<Foo:0x0000000130f48 @x=8>... -
Object
:: TRUE -> TrueClass (6201.0) -
非推奨です。代表的な真の値。true と同じ。
...非推奨です。代表的な真の値。true と同じ。
この定数は過去との互換性のために提供されています。擬似変数 true を使ってください。
Ruby では false と nil が偽として扱われます。
偽でない値(false でも nil でもない値) は全...