2559件ヒット
[201-300件を表示]
(0.506秒)
種類
ライブラリ
- ビルトイン (1625)
- csv (11)
- delegate (11)
- erb (11)
- forwardable (11)
-
irb
/ extend-command (11) - json (77)
- monitor (11)
-
mutex
_ m (11) - objspace (44)
- openssl (44)
- optparse (132)
- pp (33)
- psych (28)
-
rdoc
/ code _ object (11) -
rdoc
/ known _ classes (11) - singleton (11)
- timeout (35)
- win32ole (77)
クラス
-
ARGF
. class (176) - BasicObject (132)
- CSV (11)
- Class (66)
- Dir (66)
- ERB (11)
- File (33)
- Hash (33)
- IO (44)
-
JSON
:: Parser (22) -
JSON
:: State (11) - Method (84)
- Module (254)
- NameError (9)
- Object (453)
-
OpenSSL
:: ASN1 :: ObjectId (22) - OptionParser (132)
- PP (11)
-
RDoc
:: CodeObject (11) -
WIN32OLE
_ TYPE (44) -
WIN32OLE
_ TYPELIB (33)
モジュール
- Enumerable (110)
-
IRB
:: ExtendCommandBundle (11) - JSON (22)
-
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (11) - Kernel (71)
- Marshal (22)
- ObjectSpace (132)
-
OpenSSL
:: ASN1 (22) - Psych (17)
- RDoc (11)
- Timeout (19)
キーワード
- ! (11)
- != (11)
-
$ FILENAME (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - < (11)
- <=> (11)
- === (18)
- ARGF (22)
- BasicObject (11)
- Class (11)
- DelegateClass (11)
- FALSE (8)
- Forwardable (11)
-
KNOWN
_ CLASSES (11) - Marshal フォーマット (11)
- Method (11)
- MonitorMixin (11)
-
Mutex
_ m (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 6 . 0 (6) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - NIL (8)
- ObjectId (22)
- Options (11)
- Ruby プログラムの実行 (11)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (11)
- Ruby用語集 (11)
- Singleton (11)
- String (11)
- TRUE (8)
- [] (22)
-
_ dump (11) -
_ load (11) - allocate (11)
- ancestors (11)
- argv (11)
-
boot
_ defclass (11) - call (22)
- class (11)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) - clone (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (22)
-
count
_ objects (11) -
count
_ objects _ size (11) -
count
_ tdata _ objects (11) - coverage (7)
-
create
_ id (11) - debug (11)
-
def
_ class (11) -
def
_ extend _ command (11) -
default
_ event _ sources (11) -
define
_ finalizer (22) -
define
_ singleton _ method (22) - display (11)
- drb (11)
-
drb
/ extservm (11) - dump (22)
- dup (11)
- each (44)
-
each
_ byte (22) -
each
_ char (22) -
each
_ line (44) -
each
_ object (44) - extend (11)
-
for
_ fd (11) - getbyte (11)
- getc (11)
-
global
_ variables (11) - include (11)
- initialize (11)
-
initialize
_ copy (11) - inspect (22)
-
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variables (11) - irb (11)
-
irb
/ completion (11) -
is
_ a? (11) -
kind
_ of? (11) -
local
_ variables (11) -
marshal
_ dump (11) -
marshal
_ load (11) - max (44)
-
method
_ missing (11) - methods (11)
- min (44)
-
module
_ eval (22) -
module
_ exec (11) - new (154)
-
object
_ group (11) -
ole
_ classes (22) -
ole
_ type (11) -
ole
_ types (11) - on (132)
- open (88)
- parameters (11)
- parse (11)
-
pretty
_ print (11) -
private
_ constant (9) -
public
_ constant (9) -
public
_ method (11) - putc (11)
-
rb
_ class _ real (11) -
rb
_ define _ class _ under (11) -
rb
_ obj _ class (11) - rdoc (11)
-
reachable
_ objects _ from (11) - receiver (20)
-
remove
_ class _ variable (11) -
remove
_ classes _ and _ modules (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) - replace (11)
-
respond
_ to? (11) -
respond
_ to _ missing? (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby 1
. 9 feature (11) -
safe
_ load (17) - send (22)
-
singleton
_ class (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) -
sort
_ by (22) - superclass (11)
- timeout (35)
-
to
_ ary (11) -
to
_ int (11) -
to
_ json (11) -
to
_ json _ raw _ object (11) -
to
_ proc (11) -
to
_ s (22) -
to
_ str (11) -
trace
_ object _ allocations (11) -
undefine
_ finalizer (11) - yaml (11)
-
yaml
_ tag (11) - オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (11)
- クラス/メソッドの定義 (11)
- メソッド呼び出し(super・ブロック付き・yield) (11)
- 変数と定数 (11)
検索結果
先頭5件
-
Object
. yaml _ tag(tag) -> () (21042.0) -
クラスと tag の間を関連付けます。
...るタグの文字列
=== Example
require 'psych'
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:e......xample.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... -
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 も参照してください。
... Object#== を呼び出します。
when 節の式をレシーバーとして === を呼び出すことに注意してください。
また Enumerable#grep でも使用されます。
@param other 比較するオブジェクトです。
//emlist[][ruby]{
age = 12
# (0..2).===(12), (3..6).===(12......ance 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#===, Regexp#===, Enumerable... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (21024.0) -
self に特異メソッド name を定義します。
...n メソッド名を表す 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(:hello) { "#{self}... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (21024.0) -
self に特異メソッド name を定義します。
...n メソッド名を表す 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(:hello) { "#{self}... -
Object
# display(out = $ stdout) -> nil (21024.0) -
オブジェクトを out に出力します。
...st[][ruby]{
class Object
def display(out = $stdout)
out.write self
nil
end
end
//}
@param out 出力先のIOオブジェクトです。指定しない場合は標準出力に出力されます。
@return nil を返します。
//emlist[][ruby]{
Object.new.display #=> #<Object:0xbb0210>... -
Object
# extend(*modules) -> self (21024.0) -
引数で指定したモジュールのインスタンスメソッドを self の特異 メソッドとして追加します。
...//emlist[][ruby]{
module Foo
def a
'ok Foo'
end
end
module Bar
def b
'ok Bar'
end
end
obj = Object.new
obj.extend Foo, Bar
p obj.a #=> "ok Foo"
p obj.b #=> "ok Bar"
class Klass
include Foo
extend Bar
end
p Klass.new.a #=> "ok Foo"
p Klass.b #=> "ok Bar"
//}
extend の......ただしその場合、フック用のメソッド
が Module#extended ではなく Module#included になるという違いがあります。
//emlist[][ruby]{
# obj.extend Foo, Bar とほぼ同じ
class << obj
include Foo, Bar
end
//}
@see Module#extend_object,Module#include,Module#extended...