2797件ヒット
[201-300件を表示]
(0.120秒)
別のキーワード
種類
ライブラリ
- ビルトイン (1776)
- csv (12)
- delegate (12)
- erb (12)
- forwardable (12)
-
irb
/ extend-command (12) - json (84)
- monitor (12)
-
mutex
_ m (12) - objspace (48)
- openssl (48)
- optparse (144)
- pp (36)
- psych (31)
-
rdoc
/ code _ object (12) -
rdoc
/ known _ classes (12) - singleton (12)
- timeout (37)
- win32ole (84)
クラス
-
ARGF
. class (192) - BasicObject (144)
- CSV (12)
- Class (72)
- Dir (72)
- ERB (12)
- File (36)
- Hash (36)
- IO (48)
-
JSON
:: Parser (24) -
JSON
:: State (12) - Method (92)
- Module (282)
- NameError (10)
- Object (492)
-
OpenSSL
:: ASN1 :: ObjectId (24) - OptionParser (144)
- PP (12)
-
RDoc
:: CodeObject (12) -
WIN32OLE
_ TYPE (48) -
WIN32OLE
_ TYPELIB (36)
モジュール
- Enumerable (120)
-
IRB
:: ExtendCommandBundle (12) - JSON (24)
-
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) - Kernel (76)
- Marshal (24)
- ObjectSpace (144)
-
OpenSSL
:: ASN1 (24) - Psych (19)
- RDoc (12)
- Timeout (21)
キーワード
- ! (12)
- != (12)
-
$ FILENAME (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- <=> (12)
- == (12)
- === (20)
- ARGF (24)
- BasicObject (12)
- Class (12)
- DelegateClass (12)
- FALSE (8)
- Forwardable (12)
-
KNOWN
_ CLASSES (12) - Marshal フォーマット (12)
- Method (12)
- MonitorMixin (12)
-
Mutex
_ m (12) -
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 1 . 0 (12) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) - NIL (8)
- ObjectId (24)
- Options (12)
- Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- Singleton (12)
- String (12)
- TRUE (8)
- [] (24)
-
_ _ send _ _ (24) -
_ dump (12) -
_ load (12) - allocate (12)
- ancestors (12)
- argv (12)
-
boot
_ defclass (12) - call (24)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ get (12) -
class
_ variables (12) - clone (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (24)
-
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - coverage (8)
-
create
_ id (12) - debug (12)
-
def
_ class (12) -
def
_ extend _ command (12) -
default
_ event _ sources (12) -
define
_ finalizer (24) -
define
_ singleton _ method (24) - display (12)
- drb (12)
-
drb
/ extservm (12) - dump (24)
- dup (12)
- each (48)
-
each
_ byte (24) -
each
_ char (24) -
each
_ line (48) -
each
_ object (48) - extend (12)
-
for
_ fd (12) - getbyte (12)
- getc (12)
-
global
_ variables (12) - include (12)
- initialize (12)
-
initialize
_ copy (12) - inspect (24)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variables (12) - irb (12)
-
irb
/ completion (12) -
is
_ a? (12) -
kind
_ of? (12) -
local
_ variables (12) -
marshal
_ dump (12) -
marshal
_ load (12) - max (48)
-
method
_ missing (12) - methods (12)
- min (48)
-
module
_ eval (24) -
module
_ exec (12) - new (168)
-
object
_ group (12) -
ole
_ classes (24) -
ole
_ type (12) -
ole
_ types (12) - on (144)
- open (96)
- parameters (12)
- parse (12)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) -
private
_ constant (9) -
public
_ constant (9) -
public
_ method (12) - putc (12)
-
rb
_ class _ real (12) -
rb
_ define _ class _ under (12) -
rb
_ obj _ class (12) - rdoc (12)
-
reachable
_ objects _ from (12) - receiver (22)
-
remove
_ class _ variable (12) -
remove
_ classes _ and _ modules (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby 1
. 9 feature (12) -
safe
_ load (19) - send (24)
-
singleton
_ class (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) -
sort
_ by (24) - superclass (12)
- timeout (37)
-
to
_ ary (12) -
to
_ hash (12) -
to
_ int (12) -
to
_ json (12) -
to
_ json _ raw _ object (12) -
to
_ proc (12) -
to
_ regexp (12) -
to
_ s (24) -
to
_ str (12) -
trace
_ object _ allocations (12) -
undefine
_ finalizer (12) - yaml (12)
-
yaml
_ tag (12) - オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (12)
- クラス/メソッドの定義 (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- 変数と定数 (12)
検索結果
先頭5件
-
Object
# kind _ of?(mod) -> bool (21048.0) -
オブジェクトが指定されたクラス mod かそのサブクラスのインスタンスであるとき真を返します。
...ードしたクラスかそのサブクラス
のインスタンスである場合にも真を返します。
Module#includeだけではなく、Object#extendやModule#prependに
よってサブクラスのインスタンスになる場合も含みます。
上記のいずれでもない場合に fa......です。
//emlist[][ruby]{
module M
end
class C < Object
include M
end
class S < C
end
obj = S.new
p obj.is_a?(S) # true
p obj.is_a?(C) # true
p obj.is_a?(Object) # true
p obj.is_a?(M) # true
p obj.is_a?(Hash) # false
//}
@see Object#instance_of?,Module#===,Object#class... -
Object
# instance _ of?(klass) -> bool (21042.0) -
オブジェクトがクラス klass の直接のインスタンスである時真を返します。
...常に obj.kind_of?(c) も成立します。
@param klass Classかそのサブクラスのインスタンスです。
//emlist[][ruby]{
class C < Object
end
class S < C
end
obj = S.new
p obj.instance_of?(S) # true
p obj.instance_of?(C) # false
//}
@see Object#kind_of?,Object#class... -
Object
. yaml _ tag(tag) -> () (21042.0) -
クラスと tag の間を関連付けます。
...'
class 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
# _ dump(limit) -> String (21036.0) -
Marshal.#dump において出力するオブジェクトがメソッド _dump を定義している場合には、そのメソッドの結果が書き出されます。
...ッド _dump
を定義している場合には、そのメソッドの結果が書き出されます。
バージョン1.8.0以降ではObject#marshal_dump, Object#marshal_loadの使用
が推奨されます。 Marshal.dump するオブジェクトが _dump と marshal_dump の両方の
メソッ......ベルを表す整数です。
@return オブジェクトを文字列化したものを返すように定義すべきです。
//emlist[][ruby]{
class Foo
def initialize(arg)
@foo = arg
end
def _dump(limit)
Marshal.dump(@foo, limit)
end
def self._load(obj)
p obj
Foo.new(Ma......い場合や拡張ライブラリで定義し
たクラスのインスタンスがインスタンス変数以外に情報を保持する場合に
利用します。(例えば、クラス Time は、_dump/_load を定義して
います)
@see Object#marshal_dump, Object#marshal_load, Class#_load... -
Object
# respond _ to?(name , include _ all = false) -> bool (21030.0) -
オブジェクトがメソッド name を持つとき真を返します。
...されたメソッドで NotImplementedError が発生する場合は true を返します。
メソッドが定義されていない場合は、Object#respond_to_missing? を呼
び出してその結果を返します。
@param name Symbol または文字列で指定するメソッド名です。......す。省略した場合
は false(含めない) を指定した事になります。
//emlist[][ruby]{
class F
def hello
"Bonjour"
end
end
class D
private
def hello
"Guten Tag"
end
end
list = [F.new,D.new]
list.each{|it| puts it.hello if it.respond_to?(:hello......ate_method
raise NotImplementedError.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 ImplT... -
Object
# to _ s -> String (21030.0) -
オブジェクトの文字列表現を返します。
...使って文字列に変換し
ます。
//emlist[][ruby]{
class Foo
def initialize num
@num = num
end
end
it = Foo.new(40)
puts it #=> #<Foo:0x2b69110>
class Foo
def to_s
"Class:Foo Number:#{@num}"
end
end
puts it #=> Class:Foo Number:40
//}
@see Object#to_str,Kernel.#String... -
Object
# pretty _ print _ cycle(pp) -> () (21028.0) -
プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。
...た場合、
Object#pretty_print の代わりに呼ばれるメソッドです。
あるクラスの pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。
@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pre......tty_print_cycle(q)
q.text(empty? ? '[]' : '[...]')
end
end
//}
@see Object#pretty_print... -
Object
# ===(other) -> bool (21024.0) -
case 式で使用されるメソッドです。d:spec/control#case も参照してください。
...ドは case 式での振る舞いを考慮して、
各クラスの性質に合わせて再定義すべきです。
デフォルトでは内部で Object#== を呼び出します。
when 節の式をレシーバーとして === を呼び出すことに注意してください。
また Enumerable......n String
"Instance of String class. But don't hit."
else
"unknown"
end
end
puts check([]) #=> unknown
puts check("mash-up in Ruby on Rails") #=> instance of String class. But not hit...
puts check("<Ruby's world>") #=> hit! <Ruby's world>
//}
@see Object#==, Range#===, Module#===, Rege... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (21024.0) -
self に特異メソッド name を定義します。
...す。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class << self
def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hel...