別のキーワード
種類
ライブラリ
- ビルトイン (3362)
-
bigdecimal
/ util (7) - csv (84)
- erb (36)
- fiddle (12)
-
fiddle
/ import (24) - forwardable (60)
- json (144)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - monitor (12)
-
mutex
_ m (12) -
net
/ http (36) - objspace (48)
- openssl (1068)
- optparse (192)
- pp (24)
- psych (31)
- rake (24)
-
rdoc
/ known _ classes (12) -
rexml
/ document (24) -
rexml
/ streamlistener (12) -
ripper
/ filter (12) -
rubygems
/ version (12) - set (27)
- thread (2)
- timeout (37)
- tsort (93)
- win32ole (36)
クラス
-
ARGF
. class (300) - Array (60)
- BasicObject (144)
- BigDecimal (12)
- CSV (84)
- Class (100)
- Complex (12)
- Data (6)
- Date (12)
- DateTime (12)
- Dir (72)
- ERB (36)
-
Enumerator
:: Lazy (18) - Exception (24)
- FalseClass (60)
- File (60)
-
Gem
:: Version (12) - Hash (79)
- IO (60)
- Integer (12)
-
JSON
:: Parser (24) -
JSON
:: State (24) - Method (213)
- Module (720)
-
Net
:: HTTP (12) -
Net
:: HTTPResponse (24) - NilClass (170)
- Object (480)
-
OpenSSL
:: ASN1 :: BMPString (24) -
OpenSSL
:: ASN1 :: BitString (24) -
OpenSSL
:: ASN1 :: Boolean (24) -
OpenSSL
:: ASN1 :: Enumerated (24) -
OpenSSL
:: ASN1 :: GeneralString (24) -
OpenSSL
:: ASN1 :: GeneralizedTime (24) -
OpenSSL
:: ASN1 :: GraphicString (24) -
OpenSSL
:: ASN1 :: IA5String (24) -
OpenSSL
:: ASN1 :: ISO64String (24) -
OpenSSL
:: ASN1 :: Integer (24) -
OpenSSL
:: ASN1 :: Null (24) -
OpenSSL
:: ASN1 :: NumericString (24) -
OpenSSL
:: ASN1 :: OctetString (24) -
OpenSSL
:: ASN1 :: PrintableString (24) -
OpenSSL
:: ASN1 :: Sequence (24) -
OpenSSL
:: ASN1 :: Set (24) -
OpenSSL
:: ASN1 :: T61String (24) -
OpenSSL
:: ASN1 :: UTCTime (24) -
OpenSSL
:: ASN1 :: UTF8String (24) -
OpenSSL
:: ASN1 :: UniversalString (24) -
OpenSSL
:: ASN1 :: VideotexString (24) - OptionParser (192)
- Proc (26)
-
REXML
:: CData (24) - Random (2)
- Range (24)
- Rational (12)
- Regexp (24)
-
RubyVM
:: InstructionSequence (12) - Set (12)
- Struct (60)
- Thread (36)
-
Thread
:: Backtrace :: Location (48) - Time (12)
- TracePoint (48)
- TrueClass (60)
- UnboundMethod (48)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ TYPE (24)
モジュール
- Enumerable (168)
-
Fiddle
:: Importer (24) - Forwardable (48)
- JSON (36)
-
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (160)
- Marshal (24)
- ObjectSpace (144)
-
OpenSSL
:: ASN1 (540) - Psych (19)
- RDoc (12)
-
REXML
:: StreamListener (12) -
Rake
:: TaskManager (24) - TSort (93)
- Timeout (21)
キーワード
- ! (12)
- != (12)
- & (36)
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - < (12)
- << (14)
- <=> (12)
- == (24)
- === (20)
- =~ (7)
- >> (14)
- ARGF (12)
- ASN1 (12)
- BMPString (24)
- BasicObject (12)
- BitString (24)
- Boolean (24)
-
CODE
_ CLASS _ TO _ OBJ (12) - Class (12)
- Closure (12)
- ConditionVariable (12)
- DEFAULT (2)
- Enumerated (24)
- FALSE (8)
- Filter (12)
- Forwardable (12)
- GeneralString (24)
- GeneralizedTime (24)
- GraphicString (24)
- IA5String (24)
- ISO64String (24)
- Integer (24)
-
KNOWN
_ CLASSES (12) - Location (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) -
NEWS for Ruby 3
. 1 . 0 (4) - NIL (8)
- Null (24)
- Numeric (12)
- NumericString (24)
- ObjectId (24)
- OctetString (24)
- PrintableString (24)
- Proxy (12)
- ReFe (12)
- Requirement (12)
- Ruby プログラムの実行 (12)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (12)
- Ruby用語集 (12)
- Sequence (24)
- Set (24)
- String (12)
- T61String (24)
- TRUE (8)
- UTCTime (24)
- UTF8String (24)
- UnboundMethod (12)
- UniversalString (24)
- VideotexString (24)
- [] (48)
- ^ (36)
-
_ _ send _ _ (24) -
_ dump (12) -
_ load (12) -
absolute
_ path (12) - accept (24)
-
add
_ trace _ func (12) - allocate (12)
- ancestors (12)
-
append
_ features (12) - argv (12)
- arity (24)
- attr (12)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) - autoload (24)
- autoload? (12)
- backtrace (12)
-
base
_ label (12) - bind (12)
- binmode (12)
- call (24)
-
callee
_ id (12) - cgi (12)
-
cgi
/ session (12) -
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - classify (12)
- clone (36)
- close (12)
- closed? (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ missing (12) -
const
_ source _ location (12) - constants (24)
-
count
_ objects (12) -
count
_ objects _ size (12) -
count
_ tdata _ objects (12) - coverage (8)
-
create
_ id (12) -
create
_ id= (12) - debug (12)
- decode (12)
-
def
_ class (12) -
def
_ delegator (12) -
def
_ instance _ delegator (12) -
def
_ module (12) -
default
_ event _ sources (12) - define (6)
-
define
_ finalizer (24) -
define
_ method (24) -
define
_ singleton _ method (24) -
define
_ task (12) -
defined
_ class (12) - delegate (12)
- display (12)
- drb (12)
-
drb
/ extservm (12) -
drb
/ gw (12) - dump (24)
- dup (24)
-
each
_ char (24) -
each
_ codepoint (24) -
each
_ entry (24) -
each
_ object (48) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) - eager (6)
- entitydecl (12)
- eof (12)
- eof? (12)
- extend (12)
- fail (36)
- file (12)
- filename (12)
-
find
_ class _ path (12) -
fixed
_ encoding? (12) -
for
_ fd (12) -
from
_ state (12) - getbyte (12)
- getc (12)
- gets (36)
-
global
_ variables (12) - handler= (12)
- include (12)
- include? (12)
- included (12)
- inherited (12)
- initialize (12)
-
initialize
_ copy (12) -
inplace
_ mode (12) -
inplace
_ mode= (12) - inspect (72)
-
instance
_ delegate (12) -
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) - intern (12)
-
internal
_ encoding (12) - irb (12)
-
is
_ a? (12) -
json
/ add / core (12) -
json
_ creatable? (12) -
kind
_ of? (12) - lambda? (12)
-
local
_ variables (12) -
marshal
_ dump (12) -
marshal
_ load (12) - max (48)
- merge (24)
-
method
_ added (12) -
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) -
method
_ removed (12) -
method
_ undefined (12) - methods (12)
- min (48)
-
minitest
/ unit (1) -
module
_ eval (24) -
module
_ exec (12) - name (24)
- nesting (12)
- new (708)
- nil? (12)
-
ole
_ classes (12) - on (144)
- open (144)
-
original
_ name (24) - owner (24)
- parameters (12)
- parse (12)
- path (24)
- pp (12)
- prepend (12)
-
prepend
_ features (12) - prepended (12)
-
pretty
_ print (12) -
pretty
_ print _ cycle (12) - private (48)
-
private
_ class _ method (24) -
private
_ constant (12) -
private
_ method _ defined? (12) -
protected
_ method _ defined? (12) -
public
_ class _ method (24) -
public
_ constant (12) -
public
_ method (12) -
public
_ method _ defined? (12) - raise (36)
- rationalize (24)
-
rb
_ class _ real (12) -
rb
_ define _ class _ under (12) - rdoc (12)
-
rdoc
/ known _ classes (12) -
rdoc
/ parser / c (12) -
reachable
_ objects _ from (12) - read (24)
- readbyte (24)
- readchar (12)
- readlines (12)
- receiver (12)
- refine (12)
- reject (24)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
remove
_ method (12) - replace (12)
-
respond
_ to? (12) -
respond
_ to _ missing? (12) -
rexml
/ parsers / sax2parser (12) -
rexml
/ parsers / streamparser (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) -
rubygems
/ command _ manager (12) -
safe
_ load (19) - send (24)
-
set
_ trace _ func (24) -
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - skip (12)
-
sort
_ by (24) -
source
_ location (12) - stat (12)
-
strongly
_ connected _ components (12) - struct (12)
- subclasses (4)
-
super
_ method (11) - superclass (12)
-
test
/ unit (1) - timeout (37)
-
to
_ a (36) -
to
_ ary (24) -
to
_ bn (12) -
to
_ c (12) -
to
_ d (7) -
to
_ f (12) -
to
_ h (31) -
to
_ hash (12) -
to
_ i (12) -
to
_ int (12) -
to
_ json (168) -
to
_ proc (24) -
to
_ r (12) -
to
_ regexp (12) -
to
_ s (96) -
to
_ set (24) -
to
_ str (12) -
trace
_ object _ allocations (12) - tracer (12)
- tsort (24)
-
tsort
_ each (23) - unbind (12)
-
undef
_ method (12) -
undefine
_ finalizer (12) - union (12)
- value (24)
-
webrick
/ cgi (12) - yaml (12)
-
yaml
_ tag (12) - | (36)
- オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (12)
- クラス (12)
- クラス/メソッドの定義 (12)
- パターンマッチ (12)
- メソッド呼び出し(super・ブロック付き・yield) (12)
- リテラル (12)
- 制御構造 (12)
- 変数と定数 (12)
- 字句構造 (12)
- 正規表現 (12)
- 演算子式 (12)
検索結果
先頭5件
-
Class
# allocate -> object (9012.0) -
自身のインスタンスを生成して返します。生成したオブジェクトは 自身のインスタンスであること以外には何も特性を持ちません。
...。生成したオブジェクトは
自身のインスタンスであること以外には何も特性を持ちません。
//emlist[例][ruby]{
klass = Class.new do
def initialize(*args)
@initialized = true
end
def initialized?
@initialized || false
end
end
klass.allocate.initia... -
Class
# json _ creatable? -> bool (9006.0) -
シリアライズされた JSON 形式の文字列から、インスタンスを作成するのにこのクラスを使用できる場合は 真を返します。そうでない場合は、偽を返します。
...json_create というメソッドを実装していなければなりません。
また json_create の第一引数は必要なデータを含むハッシュを期待しています。
//emlist[例][ruby]{
require "json"
String.json_creatable? # => true
Dir.json_creatable? # => false
//}... -
TracePoint
# defined _ class -> Class | module (6274.0) -
メソッドを定義したクラスかモジュールを返します。
...emlist[例][ruby]{
class C; def foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => C
end.enable do
C.new.foo
end
//}
メソッドがモジュールで定義されていた場合も(include に関係なく)モジュー
ルを返します。
//emlist[例][ruby]{
module M......; def foo; end; end
class C; include M; end;
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => M
end.enable do
C.new.foo
end
//}
[注意] 特異メソッドを実行した場合は TracePoint#defined_class は特異クラ
スを返します。また、Kernel.#set_trace_func の 6......パ
ラメータは特異クラスではなく元のクラスを返します。
//emlist[例][ruby]{
class C; def self.foo; end; end
trace = TracePoint.new(:call) do |tp|
p tp.defined_class # => #<Class:C>
end.enable do
C.foo
end
//}
Kernel.#set_trace_func と TracePoint の上記の差分に... -
Object
# singleton _ class -> Class (6244.0) -
レシーバの特異クラスを返します。 まだ特異クラスがなければ、新しく作成します。
...れ NilClass, TrueClass,
FalseClass を返します。
@raise TypeError レシーバが Integer、Float、Symbol の場合に発生します。
//emlist[][ruby]{
Object.new.singleton_class #=> #<Class:#<Object:0xb7ce1e24>>
String.singleton_class #=> #<Class:String>
nil.singleton_class......#=> NilClass
//}
@see Object#class... -
ERB
# def _ class(superklass=Object , methodname=& # 39;erb& # 39;) -> Class (6236.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
...変換した Ruby スクリプトをメソッドとして定義した無名のクラスを返します。
@param superklass 無名クラスのスーパークラス
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
class MyClass_
def initialize(arg1, arg2)
@arg1 = arg1......; @arg2 = arg2
end
end
filename = 'example.rhtml' # @arg1 と @arg2 が使われている example.rhtml
erb = ERB.new(File.read(filename))
erb.filename = filename
MyClass = erb.def_class(MyClass_, 'render()')
print MyClass.new('foo', 123).render()
# => test1foo
# test2123
//}... -
Module
# class _ eval {|mod| . . . } -> object (6156.0) -
モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。
...。
つまり、そのモジュールの定義式の中にあるかのように実行されます。
ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。
定数とクラス変数のスコープは、文字列が与えられた場合とブロック......できます。
//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}
p C.new.m #=> [:m, 1]
//}
//emlist[定数のスコープが異なる例][ruby]{
class C
end
# ブロックが渡され......ルに定数 X を定義する。
C.class_eval { X = 1 }
# 文字列が渡された場合は、モジュール定義式内と同じスコープになる。つまり、この場合は
# class C
# X = 2
# end
# と書いたのと同じ意味になる。
C.class_eval 'X = 2'
p X #=> 1
p C::X #=>... -
Module
# class _ eval(expr , fname = "(eval)" , lineno = 1) -> object (6156.0) -
モジュールのコンテキストで文字列 expr またはモジュール自身をブロックパラメータとするブロックを 評価してその結果を返します。
...。
つまり、そのモジュールの定義式の中にあるかのように実行されます。
ただし、ローカル変数は module_eval/class_eval の外側のスコープと共有します。
定数とクラス変数のスコープは、文字列が与えられた場合とブロック......できます。
//emlist[例][ruby]{
class C
end
a = 1
C.class_eval %Q{
def m # メソッドを動的に定義できる。
return :m, #{a}
end
}
p C.new.m #=> [:m, 1]
//}
//emlist[定数のスコープが異なる例][ruby]{
class C
end
# ブロックが渡され......ルに定数 X を定義する。
C.class_eval { X = 1 }
# 文字列が渡された場合は、モジュール定義式内と同じスコープになる。つまり、この場合は
# class C
# X = 2
# end
# と書いたのと同じ意味になる。
C.class_eval 'X = 2'
p X #=> 1
p C::X #=>... -
VALUE rb
_ class _ real(VALUE cl) (6140.0) -
特異クラスや化身クラス (T_ICLASS) を飛ばして cl の スーパークラスを辿り、Ruby レベルに露出してもよいクラスを返します。
...特異クラスや化身クラス (T_ICLASS) を飛ばして cl の
スーパークラスを辿り、Ruby レベルに露出してもよいクラスを返します。
例:
rb_class_real(RBASIC(klass)->super)
rb_obj_class(obj) は、obj のクラスを返す汎用の関数(Object#type と
同......じ)だが、obj が Qtrue などでない RBasic 構造のものであることが
わかっているなら
rb_class_real(RBASIC(obj)->klass)
でも良い。(が、やはり rb_obj_class(obj) を使う方が無難だろう)... -
Module
# class _ variable _ defined?(name) -> bool (6137.0) -
name で与えられた名前のクラス変数がモジュールに存在する場合 true を 返します。
...name Symbol か String を指定します。
//emlist[例][ruby]{
class Fred
@@foo = 99
end
Fred.class_variable_defined?(:@@foo) #=> true
Fred.class_variable_defined?(:@@bar) #=> false
Fred.class_variable_defined?('@@foo') #=> true
Fred.class_variable_defined?('@@bar') #=> false
//}...