ライブラリ
- ビルトイン (312)
- benchmark (2)
-
cgi
/ session (1) - csv (9)
- date (2)
- dbm (1)
- delegate (9)
- digest (1)
- drb (1)
-
drb
/ gw (1) - erb (1)
- fiddle (1)
- gdbm (4)
-
io
/ console (3) -
io
/ nonblock (1) -
irb
/ cmd / chws (2) -
irb
/ cmd / pushws (3) -
irb
/ cmd / subirb (3) -
irb
/ context (3) -
irb
/ extend-command (1) -
irb
/ output-method (6) - json (21)
-
json
/ add / bigdecimal (1) -
json
/ add / complex (1) -
json
/ add / date (1) -
json
/ add / date _ time (1) -
json
/ add / exception (1) -
json
/ add / ostruct (1) -
json
/ add / range (1) -
json
/ add / rational (1) -
json
/ add / regexp (1) -
json
/ add / struct (1) -
json
/ add / symbol (1) -
json
/ add / time (1) - kconv (2)
- matrix (11)
- mkmf (4)
- monitor (4)
-
net
/ http (2) -
net
/ imap (1) -
net
/ pop (4) -
net
/ smtp (3) - observer (1)
- openssl (13)
- optparse (1)
- ostruct (3)
- pathname (2)
- pp (4)
- prettyprint (3)
- prime (3)
- pstore (4)
- psych (7)
- rake (2)
-
rdoc
/ code _ object (11) -
rdoc
/ markup (1) -
rexml
/ document (9) -
rexml
/ parsers / pullparser (2) -
rinda
/ rinda (1) -
rinda
/ tuplespace (1) -
ripper
/ filter (3) - rss (3)
-
rubygems
/ config _ file (2) -
rubygems
/ spec _ fetcher (2) -
rubygems
/ timer (1) - sdbm (2)
- shellwords (1)
- socket (4)
- stringio (8)
- strscan (2)
- tracer (1)
- weakref (2)
-
webrick
/ cgi (1) -
webrick
/ httpversion (2) - win32ole (16)
-
yaml
/ dbm (8) - zlib (3)
クラス
-
ARGF
. class (1) - Addrinfo (3)
- Array (43)
- BasicObject (14)
-
Benchmark
:: Job (2) - BigDecimal (1)
- Binding (4)
-
CGI
:: Session (1) - CSV (4)
-
CSV
:: Row (4) -
CSV
:: Table (1) - Class (2)
- Complex (2)
- DBM (1)
-
DRb
:: DRbServer (1) -
DRb
:: GW (1) - Data (1)
- Date (2)
- DateTime (2)
- Delegator (6)
- ERB (1)
- Enumerator (7)
-
Enumerator
:: Lazy (2) - Exception (1)
- Fiber (5)
-
Fiddle
:: Closure :: BlockCaller (1) - FrozenError (1)
- GDBM (4)
-
Gem
:: ConfigFile (2) -
Gem
:: SpecFetcher (2) - Hash (21)
- IO (7)
-
IRB
:: Context (3) -
IRB
:: ExtendCommand :: ChangeWorkspace (1) -
IRB
:: ExtendCommand :: CurrentWorkingWorkspace (1) -
IRB
:: ExtendCommand :: Foreground (1) -
IRB
:: ExtendCommand :: IrbCommand (1) -
IRB
:: ExtendCommand :: Kill (1) -
IRB
:: ExtendCommand :: PopWorkspace (1) -
IRB
:: ExtendCommand :: PushWorkspace (1) -
IRB
:: ExtendCommand :: Workspaces (1) -
IRB
:: OutputMethod (5) -
IRB
:: StdioOutputMethod (1) - Integer (3)
-
JSON
:: Parser (1) -
JSON
:: State (7) - KeyError (2)
- Matrix (8)
- Method (5)
- Module (14)
- Monitor (2)
-
Net
:: HTTP (1) -
Net
:: HTTPGenericRequest (1) -
Net
:: IMAP :: FetchData (1) -
Net
:: POP3 (1) -
Net
:: POPMail (3) -
Net
:: SMTP (3) - Numeric (1)
- Object (68)
-
ObjectSpace
:: WeakMap (2) -
OpenSSL
:: ASN1 :: ASN1Data (1) -
OpenSSL
:: ASN1 :: ObjectId (5) -
OpenSSL
:: X509 :: Certificate (1) -
OpenSSL
:: X509 :: ExtensionFactory (3) -
OpenSSL
:: X509 :: Request (2) - OpenStruct (4)
- OptionParser (1)
- PP (1)
- PStore (4)
- Pathname (2)
- PrettyPrint (3)
- Prime (1)
-
Prime
:: PseudoPrimeGenerator (2) - Proc (1)
-
Psych
:: ScalarScanner (1) -
Psych
:: Visitors :: YAMLTree (2) -
RDoc
:: CodeObject (11) -
RDoc
:: Markup (1) -
REXML
:: Attribute (1) -
REXML
:: Element (1) -
REXML
:: Elements (2) -
REXML
:: Parent (5) -
REXML
:: Parsers :: PullEvent (2) -
Rake
:: TaskArguments (2) - Random (4)
- Range (18)
- Rational (1)
- Regexp (2)
-
Rinda
:: DRbObjectTemplate (1) -
Rinda
:: TupleEntry (1) -
Ripper
:: Filter (3) - SDBM (2)
- Set (2)
- SimpleDelegator (2)
- String (11)
- StringIO (8)
- StringScanner (2)
- Struct (9)
- Symbol (1)
- Thread (5)
-
Thread
:: Mutex (1) -
Thread
:: Queue (3) -
Thread
:: SizedQueue (6) - Time (4)
- TracePoint (5)
- Tracer (1)
- UNIXSocket (1)
- UnboundMethod (4)
- Vector (3)
-
WEBrick
:: CGI (1) -
WEBrick
:: HTTPVersion (2) - WIN32OLE (7)
-
WIN32OLE
_ EVENT (2) -
WIN32OLE
_ PARAM (1) -
WIN32OLE
_ TYPE (1) -
WIN32OLE
_ TYPELIB (1) -
WIN32OLE
_ VARIABLE (1) -
WIN32OLE
_ VARIANT (3) - WeakRef (2)
-
YAML
:: DBM (8) -
Zlib
:: Deflate (1) -
Zlib
:: GzipWriter (2)
モジュール
- Comparable (2)
- DublinCoreModel (3)
- Enumerable (47)
-
IRB
:: ExtendCommandBundle (1) -
JSON
:: Generator :: GeneratorMethods :: Array (1) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (1) -
JSON
:: Generator :: GeneratorMethods :: Float (1) -
JSON
:: Generator :: GeneratorMethods :: Hash (1) -
JSON
:: Generator :: GeneratorMethods :: Integer (1) -
JSON
:: Generator :: GeneratorMethods :: NilClass (1) -
JSON
:: Generator :: GeneratorMethods :: Object (1) -
JSON
:: Generator :: GeneratorMethods :: String (2) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1) - Kernel (12)
- MonitorMixin (2)
- Observable (1)
-
OpenSSL
:: Buffering (1)
キーワード
- ! (1)
- != (2)
- !~ (1)
- << (5)
- <=> (1)
- == (3)
- === (3)
- DelegateClass (1)
- Digest (1)
- JSON (1)
- [] (24)
- []= (3)
-
_ _ getobj _ _ (3) -
_ _ id _ _ (1) -
_ _ send _ _ (2) -
_ _ setobj _ _ (3) -
_ dump (1) -
_ getproperty (1) -
_ invoke (1) - add (1)
- adjugate (1)
- all (1)
- allocate (1)
-
allow
_ nan? (1) -
arg
_ config (1) - at (1)
- attr (1)
- begin (1)
- bind (1)
-
bind
_ call (2) -
body
_ stream (1) - bsearch (3)
- bytes (1)
- call (3)
-
chunk
_ while (1) - clamp (3)
- class (1)
-
class
_ eval (2) -
class
_ exec (1) -
class
_ variable _ get (1) -
class
_ variable _ set (1) - clone (1)
-
cofactor
_ expansion (1) - collect (3)
- column (2)
- comment= (1)
- component (2)
- configure (1)
- conjugate (1)
-
connect
_ from (1) -
connect
_ to (1) -
const
_ get (1) -
const
_ set (1) - context (1)
- convert (4)
- cooked (1)
- count (2)
-
create
_ extension (1) - cycle (1)
-
dc
_ subject (1) -
dc
_ subject= (1) -
dc
_ subjects (1) - deconstruct (3)
-
def
_ class (1) - default (3)
-
define
_ singleton _ method (2) - delete (11)
-
delete
_ at (1) -
delete
_ field (1) -
delete
_ observer (1) - deq (2)
- detect (1)
- dig (4)
- disable (1)
- disjoint? (1)
- display (1)
-
document
_ children (1) -
document
_ children= (1) -
document
_ self (1) -
document
_ self= (1) - dup (1)
- each (3)
-
each
_ entry (1) -
each
_ with _ object (2) - element (2)
- enable (1)
- encode (3)
- end (1)
- enq (1)
- entries (2)
-
enum
_ for (2) - eql? (1)
- equal? (2)
- eval (1)
- execute (8)
- exit (1)
- extend (1)
-
extend
_ object (1) - extended (1)
- feed (1)
- fetch (12)
-
fetch
_ spec (1) -
fetch
_ values (2) - field (1)
- filter (3)
-
filter
_ map (1) - find (1)
-
find
_ all (1) -
find
_ index (1) - first (4)
- flush (1)
- freeze (1)
- front (1)
- frozen? (1)
- getlocal (2)
- grep (2)
-
grep
_ v (2) - group (1)
- handler (1)
- handler= (1)
- hash (1)
- indent= (1)
- initialize (1)
-
initialize
_ clone (1) -
initialize
_ copy (1) -
initialize
_ dup (1) - inject (4)
- inspect (1)
-
inspect
_ mode (1) -
instance
_ eval (2) -
instance
_ exec (1) -
instance
_ of? (1) -
instance
_ variable _ defined? (1) -
instance
_ variable _ get (1) -
instance
_ variable _ set (1) -
instance
_ variables (1) - invoke (1)
- irb (1)
-
irb
_ exit (1) -
is
_ a? (1) - item (1)
- jisx0301 (1)
- jj (1)
- join (4)
- key (2)
- keys (1)
-
kind
_ of? (1) -
laplace
_ expansion (1) - last (3)
- listen (1)
- ljust (1)
- ln (1)
-
load
_ file (1) -
load
_ specs (1) -
local
_ variable _ get (1) -
local
_ variable _ set (1) -
long
_ name (1) - lookup (1)
- mail (1)
- main (1)
- major (1)
- major= (1)
-
major
_ version (2) - map (2)
-
marshal
_ dump (1) -
marshal
_ load (2) - match (2)
- max (8)
-
max
_ by (1) - merge (1)
- method (1)
-
method
_ missing (3) - methods (1)
- min (8)
-
min
_ by (1) - minmax (4)
-
minmax
_ by (1) -
module
_ eval (2) -
module
_ exec (1) -
mon
_ synchronize (2) - new (1)
- next (1)
- nil? (1)
- noecho (1)
- nonblock (1)
-
object
_ group (1) -
object
_ id (1) -
object
_ nl= (1) - oid (1)
-
ole
_ obj _ help (1) -
ole
_ type (1) -
on
_ XXX (1) -
on
_ default (1) - one? (2)
- open (1)
- pack (2)
- parameters (4)
- params (1)
- parent= (1)
-
parent
_ file _ name (1) -
parent
_ name (1) - parse (2)
- peek (1)
- pop (4)
- pp (1)
- ppx (1)
-
pretty
_ print (1) -
pretty
_ print _ cycle (1) -
pretty
_ print _ inspect (1) - print (3)
- printf (1)
- printn (1)
-
private
_ methods (1) -
protected
_ methods (1) -
psych
_ to _ yaml (1) -
psych
_ y (1) -
public
_ method (1) -
public
_ methods (1) -
public
_ send (2) - push (3)
- putc (4)
- puts (4)
- raise (3)
- rand (3)
- raw (1)
-
rcptto
_ list (1) - receiver (2)
-
recv
_ io (1) - reduce (3)
- reject (11)
- reject! (5)
-
remove
_ class _ variable (1) -
remove
_ const (1) -
remove
_ instance _ variable (1) - report (1)
-
respond
_ to? (1) -
respond
_ to _ missing? (1) - resume (1)
-
return
_ value (1) - rjust (1)
- sample (2)
-
scan
_ full (1) -
search
_ full (1) - section= (1)
- select (5)
- self (1)
- send (2)
- shelljoin (1)
- shift (4)
-
short
_ name (1) -
singleton
_ class (1) -
singleton
_ method (1) -
singleton
_ method _ added (1) -
singleton
_ method _ removed (1) -
singleton
_ method _ undefined (1) -
singleton
_ methods (1) - slice (1)
- slice! (1)
-
slice
_ when (2) - sn (1)
- sort (2)
-
sort
_ by (1) - space= (1)
-
space
_ before= (1) - start (4)
-
start
_ doc (1) -
stop
_ doc (1) - store (2)
- strftime (2)
- subject (1)
- subject= (2)
-
subject
_ certificate= (1) -
subject
_ request= (1) - sum (4)
- synchronize (3)
- syswrite (1)
- tap (1)
- text (2)
- then (2)
-
thread
_ variable _ get (1) - time (1)
-
to
_ a (4) -
to
_ ary (1) -
to
_ c (1) -
to
_ enum (2) -
to
_ int (1) -
to
_ json (21) -
to
_ json _ raw (1) -
to
_ s (1) -
to
_ str (1) -
to
_ yaml (1) - tojis (1)
- tokenize (1)
- tosjis (1)
-
trace
_ func (1) - transaction (1)
- transfer (1)
-
unconverted
_ fields? (1) - unpack (1)
- unpack1 (1)
- unshift (2)
- value (3)
- values (2)
-
values
_ at (3) -
with
_ object (4) -
with
_ werror (2) - write (2)
-
write
_ nonblock (1) - xpopen (1)
- y (1)
-
yield
_ self (2) - zip (2)
検索結果
先頭5件
- JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String - JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String - JSON
:: Generator :: GeneratorMethods :: FalseClass # to _ json(state _ or _ hash = nil) -> String - JSON
:: Generator :: GeneratorMethods :: Float # to _ json(state _ or _ hash = nil) -> String - JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String
-
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (63658.0) -
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
自身を to_s で文字列にした結果を JSON 形式の文字列に変換して返します。
このメソッドはあるオブジェクトに to_json メソッドが定義されていない場合に使用する
フォールバックのためのメソッドです。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby... -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
[1, 2, 3].to_json # => "[1,2,3]"
//} -
JSON
:: Generator :: GeneratorMethods :: FalseClass # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"false" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
false.to_json # => "false"
//} -
JSON
:: Generator :: GeneratorMethods :: Float # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
(1.0).to_json # => "1.0"
//} -
JSON
:: Generator :: GeneratorMethods :: Hash # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
person = { "name" => "tanaka", "age" => 19 }
person.to_json # ... -
JSON
:: Generator :: GeneratorMethods :: Integer # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
10.to_json # => "10"
//} -
JSON
:: Generator :: GeneratorMethods :: NilClass # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"null" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
nil.to_json # => "null"
//} -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]... -
JSON
:: Generator :: GeneratorMethods :: String # to _ json _ raw -> String (63622.0) -
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
自身に対して JSON::Generator::GeneratorMethods::String#to_json_raw_object を呼び出して JSON::Generator::GeneratorMethods::Hash#to_json した結果を返します。
@see JSON::Generator::GeneratorMethods::String#to_json_raw_object, JSON::Generator::GeneratorMethods::Hash#to_json -
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (63622.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//} -
Kernel
# j(*objects) -> nil (54661.0) -
与えられたオブジェクトを JSON 形式の文字列で標準出力に一行で出力します。
与えられたオブジェクトを JSON 形式の文字列で標準出力に一行で出力します。
@param objects JSON 形式で出力したいオブジェクトを指定します。
//emlist[例][ruby]{
require "json"
j([1,2,{"name" => "tanaka","age" => 19}])
# => [1,2,{"name":"tanaka","age":19}]
//}
@see Kernel.#p -
OpenSSL
:: X509 :: ExtensionFactory # create _ extension(obj) -> OpenSSL :: X509 :: Extension (46276.0) -
OpenSSL::X509::Extension のインスタンスを生成して返します。
OpenSSL::X509::Extension のインスタンスを生成して返します。
引数の個数が1個である場合、それが配列、ハッシュ、文字列のいずれかである
ならば、
OpenSSL::X509::ExtensionFactory#create_ext_from_array、
OpenSSL::X509::ExtensionFactory#create_ext_from_hash、
OpenSSL::X509::ExtensionFactory#create_ext_from_string、
がそれぞれ呼びだされてオブジェクトを生成します。
引数が2個以上である場合は、
OpenSSL:... -
Delegator
# _ _ setobj _ _ (obj) -> object (45640.0) -
委譲先のオブジェクトをセットします。
委譲先のオブジェクトをセットします。
@param obj 委譲先のオブジェクトを指定します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。 -
OpenSSL
:: X509 :: ExtensionFactory # subject _ certificate=(name) (45640.0) -
自身に所有者(subject)の証明書オブジェクトを設定します。
自身に所有者(subject)の証明書オブジェクトを設定します。
@param cert 設定する証明書(OpenSSL::X509::Certificate)オブジェクト
@see OpenSSL::X509::ExtensionFactory.new -
SimpleDelegator
# _ _ setobj _ _ (obj) -> object (45640.0) -
委譲先のオブジェクトを obj に変更します。
委譲先のオブジェクトを obj に変更します。
メソッド委譲を行うためのクラスメソッドの再定義は行われないことに注意してください。
メソッド委譲を行うためのクラスメソッドの定義は生成時にのみ行われます。
そのため、以前の委譲先オブジェクトと
obj の間で呼び出せるメソッドに違いがあった場合は、
何かしらの例外が発生する可能性があります。
@param obj 委譲先のオブジェクト
@return 変更後の委譲先オブジェクト -
Delegator
# _ _ getobj _ _ -> object (45622.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
本メソッドは、サブクラスで再定義する必要があり、
デフォルトでは NotImplementedError が発生します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。 -
Object
# object _ id -> Integer (45622.0) -
各オブジェクトに対して一意な整数を返します。あるオブジェクトに対し てどのような整数が割り当てられるかは不定です。
各オブジェクトに対して一意な整数を返します。あるオブジェクトに対し
てどのような整数が割り当てられるかは不定です。
Rubyでは、(Garbage Collectされていない)アクティブなオブジェクト間で
重複しない整数(object_id)が各オブジェクトにひとつずつ割り当てられています。この
メソッドはその値を返します。
TrueClass, FalseClass, NilClass, Symbol, Integer クラス
のインスタンスなど Immutable(変更不可)なオブジェクトの一部は同じ内容ならば必ず同じ object_id になります。
これは、Immutable ... -
SimpleDelegator
# _ _ getobj _ _ -> object (45622.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
@see Delegator#__getobj__ -
Prime
:: PseudoPrimeGenerator # with _ object(obj) {|prime , obj| . . . } -> object (36976.0) -
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
@param obj 任意のオブジェクトを指定します。
@return 最初に与えられたオブジェクトを返します。
@return ブロックを与えられた場合は obj を返します。ブロックを与えられなかった場合は Enumerator を返します。
@see Enumerator#with_object -
Module
# extend _ object(obj) -> object (36958.0) -
Object#extend の実体です。オブジェクトにモジュールの機能を追加します。
Object#extend の実体です。オブジェクトにモジュールの機能を追加します。
Object#extend は、Ruby で書くと以下のように定義できます。
//emlist[例][ruby]{
def extend(*modules)
modules.reverse_each do |mod|
# extend_object や extended はプライベートメソッドなので
# 直接 mod.extend_object(self) などとは書けない
mod.__send__(:extend_object, self)
mod.__send__... -
OpenSSL
:: X509 :: Request # subject=(subject) (36958.0) -
証明書署名要求の申請者名を設定します。
証明書署名要求の申請者名を設定します。
@param subject 設定する名前を OpenSSL::X509::Name で渡します
@raise OpenSSL::X509::RequestError 名前の設定に失敗した場合に発生します
@see OpenSSL::X509::Request#subject -
Array
# reject {|item| . . . } -> [object] (36940.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
各要素に対してブロックを評価し、
その値が偽であった要素を集めた新しい配列を返します。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Array#select, Enumerable#reject
@see Enumerable#grep_v -
Enumerable
# each _ with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (36940.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object -
Enumerable
# inject(init = self . first) {|result , item| . . . } -> object (36940.0) -
リストのたたみこみ演算を行います。
リストのたたみこみ演算を行います。
最初に初期値 init と self の最初の要素を引数にブロックを実行します。
2 回目以降のループでは、前のブロックの実行結果と
self の次の要素を引数に順次ブロックを実行します。
そうして最後の要素まで繰り返し、最後のブロックの実行結果を返します。
要素が存在しない場合は init を返します。
初期値 init を省略した場合は、
最初に先頭の要素と 2 番目の要素をブロックに渡します。
また要素が 1 つしかなければブロックを実行せずに最初の要素を返します。
要素がなければブロックを実行せずに nil を返します。
@param in... -
Enumerable
# inject(init , sym) -> object (36940.0) -
リストのたたみこみ演算を行います。
リストのたたみこみ演算を行います。
最初に初期値 init と self の最初の要素を引数にブロックを実行します。
2 回目以降のループでは、前のブロックの実行結果と
self の次の要素を引数に順次ブロックを実行します。
そうして最後の要素まで繰り返し、最後のブロックの実行結果を返します。
要素が存在しない場合は init を返します。
初期値 init を省略した場合は、
最初に先頭の要素と 2 番目の要素をブロックに渡します。
また要素が 1 つしかなければブロックを実行せずに最初の要素を返します。
要素がなければブロックを実行せずに nil を返します。
@param in... -
Enumerable
# inject(sym) -> object (36940.0) -
リストのたたみこみ演算を行います。
リストのたたみこみ演算を行います。
最初に初期値 init と self の最初の要素を引数にブロックを実行します。
2 回目以降のループでは、前のブロックの実行結果と
self の次の要素を引数に順次ブロックを実行します。
そうして最後の要素まで繰り返し、最後のブロックの実行結果を返します。
要素が存在しない場合は init を返します。
初期値 init を省略した場合は、
最初に先頭の要素と 2 番目の要素をブロックに渡します。
また要素が 1 つしかなければブロックを実行せずに最初の要素を返します。
要素がなければブロックを実行せずに nil を返します。
@param in... -
Enumerable
# reject {|item| . . . } -> [object] (36940.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
各要素に対してブロックを評価し、
その値が偽であった要素を集めた新しい配列を返します。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Enumerable#select, Array#reject
@see Enumerable#grep_v -
Enumerator
# with _ object(obj) {|(*args) , memo _ obj| . . . } -> object (36940.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
obj には任意のオブジェクトを渡すことができます。
ブロックが渡されなかった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object... -
Object
# protected _ methods(include _ inherited = true) -> [Symbol] (36940.0) -
そのオブジェクトが理解できる protected メソッド名の一覧を返します。
そのオブジェクトが理解できる protected メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#protected_instance_methods,Object#methods,Object#singleton_methods -
REXML
:: Elements # inject(xpath = nil , initial = nil) {|element| . . . } -> object (36940.0) -
Enumerable#inject と同様、 各子要素に対し畳み込みをします。
Enumerable#inject と同様、
各子要素に対し畳み込みをします。
xpath を指定した場合は、その XPath 文字列に
マッチする要素に対し同様の操作をします。
@param xpath XPath文字列
@see REXML::Elements#each -
Prime
:: PseudoPrimeGenerator # with _ object(obj) -> Enumerator (36676.0) -
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
与えられた任意のオブジェクトと要素をブロックに渡して評価します。
@param obj 任意のオブジェクトを指定します。
@return 最初に与えられたオブジェクトを返します。
@return ブロックを与えられた場合は obj を返します。ブロックを与えられなかった場合は Enumerator を返します。
@see Enumerator#with_object -
Set
# disjoint?(set) -> bool (36658.0) -
self と set が互いに素な集合である場合に true を返します。
self と set が互いに素な集合である場合に true を返します。
逆に self と set の共通集合かを確認する場合には Set#intersect? を
使用します。
@param self Set オブジェクトを指定します。
@raise ArgumentError 引数が Set オブジェクトでない場合に発生します。
//emlist[][ruby]{
p Set[1, 2, 3].disjoint? Set[3, 4] # => false
p Set[1, 2, 3].disjoint? Set[4, 5] # => true
//}
@see Set#int... -
String
# ljust(width , padding = & # 39; & # 39;) -> String (36658.0) -
長さ width の文字列に self を左詰めした文字列を返します。 self の長さが width より長い時には元の文字列の複製を返します。 また、第 2 引数 padding を指定したときは 空白文字の代わりに padding を詰めます。
長さ width の文字列に self を左詰めした文字列を返します。
self の長さが width より長い時には元の文字列の複製を返します。
また、第 2 引数 padding を指定したときは
空白文字の代わりに padding を詰めます。
@param width 返り値の文字列の最小の長さ
@param padding 長さが width になるまで self の右側に詰める文字
//emlist[例][ruby]{
p "foo".ljust(10) # => "foo "
p "foo".ljust(9) # =... -
String
# rjust(width , padding = & # 39; & # 39;) -> String (36658.0) -
長さ width の文字列に self を右詰めした文字列を返します。 self の長さが width より長い時には元の文字列の複製を返します。 また、第 2 引数 padding を指定したときは 空白文字の代わりに padding を詰めます。
長さ width の文字列に self を右詰めした文字列を返します。
self の長さが width より長い時には元の文字列の複製を返します。
また、第 2 引数 padding を指定したときは
空白文字の代わりに padding を詰めます。
@param width 返り値の文字列の最小の長さ
@param padding 長さが width になるまで self の左側に詰める文字
//emlist[例][ruby]{
p "foo".rjust(10) # => " foo"
p "foo".rjust(9) # =... -
DublinCoreModel
# dc _ subject (36652.0) -
@todo
@todo -
DublinCoreModel
# dc _ subject= (36652.0) -
@todo
@todo -
DublinCoreModel
# dc _ subjects (36652.0) -
@todo
@todo -
Array
# reject -> Enumerator (36640.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
各要素に対してブロックを評価し、
その値が偽であった要素を集めた新しい配列を返します。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Array#select, Enumerable#reject
@see Enumerable#grep_v -
BigDecimal
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require 'json/add/bigdecimal'
BigDecimal('0.123456789123456789').to_json # => "{\"... -
Complex
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require 'json/add/complex'
Complex(2, 3).to_json # => "{\"json_class\":\"Complex\"... -
Date
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
Date.today.to_json
# => "{\"json_class\":\"Date\",\"y\":2018,\"m\":12... -
DateTime
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
DateTime.now.to_json
# => "{\"json_class\":\"DateTime\",\"y\":2018,\"... -
Enumerable
# each _ with _ object(obj) -> Enumerator (36640.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object -
Enumerable
# reject -> Enumerator (36640.0) -
各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。
各要素に対してブロックを評価し、
その値が偽であった要素を集めた新しい配列を返します。
条件を反転させた select です。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}
@see Enumerable#select, Array#reject
@see Enumerable#grep_v -
Enumerator
# with _ object(obj) -> Enumerator (36640.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
obj には任意のオブジェクトを渡すことができます。
ブロックが渡されなかった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumerator を返します。
//emlist[例][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object... -
Enumerator
:: Lazy # reject {|item| . . . } -> Enumerator :: Lazy (36640.0) -
Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。
Enumerable#reject と同じですが、配列ではなくEnumerator::Lazy を返します。
@raise ArgumentError ブロックを指定しなかった場合に発生します。
//emlist[例][ruby]{
1.step.lazy.reject { |i| i.even? }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:reject>
1.step.lazy.reject { |i| i.even? }.take(10).force
# => [1, 3, 5, 7, ... -
Exception
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
begin
0/0
rescue => e
e.to_json # => "{\"json_class\":\"ZeroDivis... -
Matrix
# adjugate -> Matrix (36640.0) -
余因子行列を返します。
余因子行列を返します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[7,6],[3,9]].adjugate # => Matrix[[9, -6], [-3, 7]]
//}
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方でない場合に発生します。
@see Matrix#cofactor -
OpenSSL
:: X509 :: Certificate # subject=(name) (36640.0) -
証明書の所有者の名前を設定します。
証明書の所有者の名前を設定します。
@param name 所有者の名前の OpenSSL::X509::Name オブジェクト
@raise OpenSSL::X509::CertificateError 設定に失敗した場合に発生します -
OpenSSL
:: X509 :: ExtensionFactory # subject _ request=(req) (36640.0) -
自身に証明書署名要求オブジェクトを設定します。
自身に証明書署名要求オブジェクトを設定します。
@param req 設定する証明書署名要求(OpenSSL::X509::Request)オブジェクト
@see OpenSSL::X509::ExtensionFactory.new -
OpenSSL
:: X509 :: Request # subject -> OpenSSL :: X509 :: Name (36640.0) -
証明書署名要求の申請者名を返します。
証明書署名要求の申請者名を返します。
@raise OpenSSL::X509::RequestError 名前の取得に失敗した場合に発生します
@see OpenSSL::X509::Request#subject= -
OpenStruct
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
@see JSON::Generator::GeneratorMethods::Hash#to_json -
OptionParser
# reject(klass) -> () (36640.0) -
OptionParser#accept で登録したクラスとブロックを 自身から削除します。
OptionParser#accept で登録したクラスとブロックを
自身から削除します。
@param klass 自身から削除したいクラスを指定します。
//emlist[例][ruby]{
require "optparse"
require "time"
def parse(option_parser)
option_parser.on("-t", "--time [TIME]", Time) do |time|
p time.class
end
option_parser.parse(ARGV)
end
opts = OptionParser.new
o... -
PP
# object _ group(obj) { . . . } -> () (36640.0) -
以下と等価な働きをするもので簡便のために用意されています。 group(1, '#<' + obj.class.name, '>') { ... }
以下と等価な働きをするもので簡便のために用意されています。
group(1, '#<' + obj.class.name, '>') { ... }
@param obj 表示したいオブジェクトを指定します。
@see PrettyPrint#group -
Range
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
(1..5).to_json # => "{\"json_class\":\"Range\",\"a\":[1,5,false]}"
//... -
Rational
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rationa... -
Struct
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
Person = Struct.new(:name, :age)
Person.new("tanaka", 29).to_json # =... -
Symbol
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
@see JSON::Generator::GeneratorMethods::Hash#to_json -
Time
# to _ json(*args) -> String (36640.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
//emlist[例][ruby]{
require "json/add/core"
Time.now.to_json # => "{\"json_class\":\"Time\",\"s\":1544968675,\"n\... -
WeakRef
# _ _ getobj _ _ -> object (36640.0) -
自身の参照先のオブジェクトを返します。
自身の参照先のオブジェクトを返します。
@raise WeakRef::RefError GC 済みのオブジェクトを参照した場合に発生します。
@see delegate -
DBM
# reject { |key , value| . . . } -> Hash (36622.0) -
ブロックを評価した値が真であれば該当する要素を削除します。
ブロックを評価した値が真であれば該当する要素を削除します。
self.to_hash.reject{|key, value| ... }
と同じです。
@see Hash#reject -
GDBM
# reject {|key , value| . . . } -> Hash (36622.0) -
ブロックを評価した値が真であれば該当する要素を削除します。
ブロックを評価した値が真であれば該当する要素を削除します。
self.to_hash.reject{|key, value| ... }
と同じです。
@see Hash#reject -
Hash
# reject -> Enumerator (36622.0) -
self を複製して、ブロックを評価した値が真になる要 素を削除したハッシュを返します。
self を複製して、ブロックを評価した値が真になる要
素を削除したハッシュを返します。
ハッシュを返すことを除けば
Enumerable#reject とほぼ同じです。
selfを破壊的に変更したい場合はかわりにHash#delete_ifかHash#reject!を使います。
//emlist[例][ruby]{
h = { 2 =>"8" ,4 =>"6" ,6 =>"4" ,8 =>"2" }
p h.reject{|key, value| key.to_i < value.to_i} #=> {6=>"4", 8=>"2"}
//}
@see Hash#delete_if,... -
Hash
# reject {|key , value| . . . } -> Hash (36622.0) -
self を複製して、ブロックを評価した値が真になる要 素を削除したハッシュを返します。
self を複製して、ブロックを評価した値が真になる要
素を削除したハッシュを返します。
ハッシュを返すことを除けば
Enumerable#reject とほぼ同じです。
selfを破壊的に変更したい場合はかわりにHash#delete_ifかHash#reject!を使います。
//emlist[例][ruby]{
h = { 2 =>"8" ,4 =>"6" ,6 =>"4" ,8 =>"2" }
p h.reject{|key, value| key.to_i < value.to_i} #=> {6=>"4", 8=>"2"}
//}
@see Hash#delete_if,... -
JSON
:: State # object _ nl=(string) (36622.0) -
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。
JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列をセットします。
@param string JSON 形式の文字列中に現れる JavaScript のオブジェクトの行末に挿入する文字列を指定します。
//emlist[例][ruby]{
require "json"
json_state = JSON::State.new(object_nl: "")
json_state.object_nl # => ""
puts JSON.generate([1, 2, { name: "tanaka", age: 19 }]... -
Regexp
# to _ json(*args) -> String (36622.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json
に渡されます。
//emlist[例][ruby]{
require "json/add/core"
/0\d{1,4}-\d{1,4}-\d{4}/.to_json # => "{\"json_class\":\"... -
SDBM
# reject {|key , value| . . . } -> Hash (36622.0) -
ブロックを評価した値が真であれば該当する要素を削除します。
ブロックを評価した値が真であれば該当する要素を削除します。
self.to_hash.reject{|key, value| ... }
と同じです。
@see Hash#reject -
String
# tojis -> String (36622.0) -
self のエンコーディングを iso-2022-jp に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを iso-2022-jp に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-jxm0', str)
を使ってください。
@see Kconv.#tojis -
String
# tosjis -> String (36622.0) -
self のエンコーディングを shift_jis に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを shift_jis に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-sxm0', str)
を使ってください。
@see Kconv.#tosjis -
WeakRef
# _ _ setobj _ _ (obj) -> () (36622.0) -
与えられたオブジェクトを自身の参照先としてセットします。 内部用のメソッドなので使わないでください。
与えられたオブジェクトを自身の参照先としてセットします。
内部用のメソッドなので使わないでください。
@param obj 任意のオブジェクトを指定します。 -
Time
# strftime(format) -> String (28828.0) -
時刻を format 文字列に従って文字列に変換した結果を返します。
時刻を format 文字列に従って文字列に変換した結果を返します。
@param format フォーマット文字列を指定します。使用できるものは 以下の通りです。
* %A: 曜日の名称(Sunday, Monday ... )
* %a: 曜日の省略名(Sun, Mon ... )
* %B: 月の名称(January, February ... )
* %b: 月の省略名(Jan, Feb ... )
* %C: 世紀 (2009年であれば 20)
* %c: 日付と時刻 (%a %b %e %T %Y)
* %D: 日付 (%m/%d/%y)
* ... -
BasicObject
# method _ missing(name , *args) -> object (27730.0) -
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド を呼び出します。
呼びだされたメソッドが定義されていなかった時、Rubyインタプリタがこのメソッド
を呼び出します。
呼び出しに失敗したメソッドの名前 (Symbol) が name に
その時の引数が第二引数以降に渡されます。
デフォルトではこのメソッドは例外 NoMethodError を発生させます。
@param name 未定義メソッドの名前(シンボル)です。
@param args 未定義メソッドに渡された引数です。
@return ユーザー定義の method_missing メソッドの返り値が未定義メソッドの返り値で
あるかのように見えます。
//emlist[例][ruby]{... -
Object
# initialize(*args , &block) -> object (27730.0) -
ユーザ定義クラスのオブジェクト初期化メソッド。
ユーザ定義クラスのオブジェクト初期化メソッド。
このメソッドは Class#new から新しく生成されたオブ
ジェクトの初期化のために呼び出されます。他の言語のコンストラクタに相当します。
デフォルトの動作ではなにもしません。
initialize には
Class#new に与えられた引数がそのまま渡されます。
サブクラスではこのメソッドを必要に応じて再定義されること
が期待されています。
initialize という名前のメソッドは自動的に private に設定され
ます。
@param args 初期化時の引数です。
@param block 初期化時のブロック引数です。必... -
BasicObject
# instance _ eval {|obj| . . . } -> object (27712.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを
評価してその結果を返します。
オブジェクトのコンテキストで評価するとは評価中の self をそのオブジェクトにして実行するということです。
また、文字列 expr やブロック中でメソッドを定義すればそのオブジェクトの特異メソッドが定義されます。
ただし、ローカル変数だけは、文字列 expr の評価では instance_eval の外側のスコープと、ブロックの評価ではそのブロックの外側のスコープと、共有します。
メソッド定義の中で instance_eval でメソッドを定義した場... -
BasicObject
# instance _ eval(expr , filename = "(eval)" , lineno = 1) -> object (27712.0) -
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを 評価してその結果を返します。
オブジェクトのコンテキストで文字列 expr またはオブジェクト自身をブロックパラメータとするブロックを
評価してその結果を返します。
オブジェクトのコンテキストで評価するとは評価中の self をそのオブジェクトにして実行するということです。
また、文字列 expr やブロック中でメソッドを定義すればそのオブジェクトの特異メソッドが定義されます。
ただし、ローカル変数だけは、文字列 expr の評価では instance_eval の外側のスコープと、ブロックの評価ではそのブロックの外側のスコープと、共有します。
メソッド定義の中で instance_eval でメソッドを定義した場... -
Object
# initialize _ copy(obj) -> object (27694.0) -
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
(拡張ライブラリによる) ユーザ定義クラスのオブジェクトコピーの初期化メソッド。
このメソッドは self を obj の内容で置き換えます。ただ
し、self のインスタンス変数や特異メソッドは変化しません。
デフォルトでは、Object#clone の内部で Object#initialize_clone から、
また Object#dup の内部で Object#initialize_dup から呼ばれます。
initialize_copy は、Ruby インタプリタが知り得ない情報をコピーするた
めに使用(定義)されます。例えば C 言語でクラスを実装する場合、情報
をインスタ... -
Object
# remove _ instance _ variable(name) -> object (27694.0) -
オブジェクトからインスタンス変数 name を取り除き、そのインス タンス変数に設定されていた値を返します。
オブジェクトからインスタンス変数 name を取り除き、そのインス
タンス変数に設定されていた値を返します。
@param name 削除するインスタンス変数の名前をシンボルか文字列で指定します。
@raise NameError オブジェクトがインスタンス変数 name を持たない場合に発生します。
//emlist[][ruby]{
class Foo
def foo
@foo = 1
p remove_instance_variable(:@foo) #=> 1
p remove_instance_variable(:@foo) # instance v... -
Gem
:: SpecFetcher # fetch _ spec(spec , source _ uri) -> object (27688.0) -
@todo
@todo
@param spec
@param source_uri -
BasicObject
# instance _ exec(*args) {|*vars| . . . } -> object (27676.0) -
与えられたブロックをレシーバのコンテキストで実行します。
与えられたブロックをレシーバのコンテキストで実行します。
ブロック実行中は、 self がレシーバのコンテキストになるので
レシーバの持つインスタンス変数にアクセスすることができます。
@param args ブロックパラメータに渡す値です。
//emlist[例][ruby]{
class KlassWithSecret
def initialize
@secret = 99
end
end
k = KlassWithSecret.new
# 以下で x には 5 が渡される
k.instance_exec(5) {|x| @secret + x } #=> 10... -
Object
# instance _ variable _ set(var , value) -> object (27676.0) -
オブジェクトのインスタンス変数 var に値 value を設定します。
オブジェクトのインスタンス変数 var に値 value を設定します。
インスタンス変数が定義されていなければ新たに定義されます。
@param var インスタンス変数名を文字列か Symbol で指定します。
@param value 設定する値です。
@return value を返します。
//emlist[][ruby]{
obj = Object.new
p obj.instance_variable_set("@foo", 1) #=> 1
p obj.instance_variable_set(:@foo, 2) #=> 2
p obj.instance_var... -
Thread
# join(limit) -> self | nil (27676.0) -
スレッド self の実行が終了するまで、カレントスレッドを停止し ます。self が例外により終了していれば、その例外がカレントス レッドに対して発生します。
スレッド self の実行が終了するまで、カレントスレッドを停止し
ます。self が例外により終了していれば、その例外がカレントス
レッドに対して発生します。
limit を指定して、limit 秒過ぎても自身が終了しない場合、nil を返します。
@param limit タイムアウトする時間を整数か小数で指定します。単位は秒です。
@raise ThreadError join を実行することによってデッドロックが起きる場合に発生します。またカレントスレッドを join したときにも発生します。
以下は、生成したすべてのスレッドの終了を待つ例です。
threads = ... -
DateTime
# jisx0301(n = 0) -> String (27658.0) -
X 0301 書式の文字列を返します。 省略可能な引数により、印字する秒の小数点以下の桁数を与えることができます。
X 0301 書式の文字列を返します。
省略可能な引数により、印字する秒の小数点以下の桁数を与えることができます。
@param n 小数点以下の桁数
例:
require 'date'
DateTime.parse('2001-02-03T04:05:06.123456789+07:00').jisx0301(9)
#=> "H13.02.03T04:05:06.123456789+07:00" -
Object
# instance _ variable _ get(var) -> object | nil (27658.0) -
オブジェクトのインスタンス変数の値を取得して返します。
オブジェクトのインスタンス変数の値を取得して返します。
インスタンス変数が定義されていなければ nil を返します。
@param var インスタンス変数名を文字列か Symbol で指定します。
//emlist[][ruby]{
class Foo
def initialize
@foo = 1
end
end
obj = Foo.new
p obj.instance_variable_get("@foo") #=> 1
p obj.instance_variable_get(:@foo) #=> 1
p obj.instance_variab... -
Object
# method(name) -> Method (27658.0) -
オブジェクトのメソッド name をオブジェクト化した Method オブジェクトを返します。
オブジェクトのメソッド name をオブジェクト化した
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__, Objec... -
Object
# public _ method(name) -> Method (27658.0) -
オブジェクトの public メソッド name をオブジェクト化した Method オブジェクトを返します。
オブジェクトの public メソッド name をオブジェクト化した
Method オブジェクトを返します。
@param name メソッド名を Symbol または String で指定します。
@raise NameError 定義されていないメソッド名や、
protected メソッド名、 private メソッド名を引数として与えると発生します。
//emlist[][ruby]{
1.public_method(:to_int) #=> #<Method: Integer#to_int>
1.public_method(:p) # method ... -
Object
# to _ enum(method = :each , *args) -> Enumerator (27658.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"]
#... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (27658.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"]
#... -
Tracer
# trace _ func(event , file , line , id , binding , klass , *) -> object | nil (27652.0) -
@todo
@todo -
BasicObject
# singleton _ method _ added(name) -> object (27640.0) -
特異メソッドが追加された時にインタプリタから呼び出されます。
特異メソッドが追加された時にインタプリタから呼び出されます。
通常のメソッドの追加に対するフックには
Module#method_addedを使います。
@param name 追加されたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def singleton_method_added(name)
puts "singleton method \"#{name}\" was added"
end
end
obj = Foo.new
def obj.foo
end
#=> singleton method "fo... -
BasicObject
# singleton _ method _ removed(name) -> object (27640.0) -
特異メソッドが Module#remove_method に より削除された時にインタプリタから呼び出されます。
特異メソッドが Module#remove_method に
より削除された時にインタプリタから呼び出されます。
通常のメソッドの削除に対するフックには
Module#method_removedを使います。
@param name 削除されたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def singleton_method_removed(name)
puts "singleton method \"#{name}\" was removed"
end
end
obj = Foo.new
def obj.f... -
BasicObject
# singleton _ method _ undefined(name) -> object (27640.0) -
特異メソッドが Module#undef_method または undef により未定義にされた時にインタプリタから呼び出されます。
特異メソッドが Module#undef_method または
undef により未定義にされた時にインタプリタから呼び出されます。
通常のメソッドの未定義に対するフックには
Module#method_undefined を使います。
@param name 未定義にされたメソッド名が Symbol で渡されます。
//emlist[例][ruby]{
class Foo
def singleton_method_undefined(name)
puts "singleton method \"#{name}\" was undefined"
end
end
obj... -
Hash
# reject! -> Enumerator (27640.0) -
キーと値を引数としてブロックを評価した結果が真であ るような要素を self から削除します。
キーと値を引数としてブロックを評価した結果が真であ
るような要素を self から削除します。
delete_if は常に self を返します。
reject! は、要素を削除しなかった場合には nil を返し、
そうでなければ self を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
h = { 2 => "8" ,4 => "6" ,6 => "4" ,8 => "2" }
p h.reject!{|key, value| key.to_i < value.to_i } #=> { 6 => "4", 8 =... -
Hash
# reject! {|key , value| . . . } -> self|nil (27640.0) -
キーと値を引数としてブロックを評価した結果が真であ るような要素を self から削除します。
キーと値を引数としてブロックを評価した結果が真であ
るような要素を self から削除します。
delete_if は常に self を返します。
reject! は、要素を削除しなかった場合には nil を返し、
そうでなければ self を返します。
ブロックを省略した場合は Enumerator を返します。
//emlist[例][ruby]{
h = { 2 => "8" ,4 => "6" ,6 => "4" ,8 => "2" }
p h.reject!{|key, value| key.to_i < value.to_i } #=> { 6 => "4", 8 =... -
Object
# private _ methods(include _ inherited = true) -> [Symbol] (27640.0) -
そのオブジェクトが理解できる private メソッド名の一覧を返します。
そのオブジェクトが理解できる private メソッド名の一覧を返します。
@param include_inherited 偽となる値を指定すると自身のクラスのスーパークラスで定義されたメソッドを除きます。
@see Module#private_instance_methods,Object#methods,Object#singleton_methods -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (27640.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
そのオブジェクトに対して定義されている特異メソッド名
(public あるいは protected メソッド) の一覧を返します。
inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メソッドを含める場合は... -
Thread
# thread _ variable _ get(key) -> object | nil (27640.0) -
引数 key で指定した名前のスレッドローカル変数を返します。
引数 key で指定した名前のスレッドローカル変数を返します。
[注意]: Thread#[] でセットしたローカル変数(Fiber ローカル変数)と
異なり、Fiber を切り替えても同じ変数を返す事に注意してください。
例:
Thread.new {
Thread.current.thread_variable_set("foo", "bar") # スレッドローカル
Thread.current["foo"] = "bar" # Fiber ローカル
Fiber.new {
Fiber.yield ... -
WIN32OLE
_ TYPE # major _ version -> Integer (27640.0) -
型のメジャーバージョン番号を取得します。
型のメジャーバージョン番号を取得します。
@return 型のメジャーバージョン番号を整数で返します。
@raise WIN32OLERuntimeError 型属性の読み取りに失敗すると通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Word 14.0 Object Library', 'Documents')
p tobj.major_version # => 8 -
WIN32OLE
_ TYPELIB # major _ version -> Integer (27640.0) -
TypeLibのメジャーバージョン番号を取得します。
TypeLibのメジャーバージョン番号を取得します。
@return TypeLibのメジャーバージョン番号を整数で返します。
@raise WIN32OLERuntimeError TypeLibの属性が読み取れない場合に通知します。
tlib = WIN32OLE_TYPELIB.new('Microsoft Excel 14.0 Object Library')
puts tlib.major_version # => 1 -
Array
# reject! -> Enumerator (27622.0) -
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。 delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、 1 つも削除されなければ nil を返します。
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。
delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、
1 つも削除されなければ nil を返します。
ブロックが与えられなかった場合は、自身と reject! から生成した
Enumerator オブジェクトを返します。
返された Enumerator オブジェクトの each メソッドには、
もとの配列に対して副作用があることに注意してください。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4, 5]
a.dele... -
Array
# reject! {|x| . . . } -> self | nil (27622.0) -
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。 delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、 1 つも削除されなければ nil を返します。
要素を順番にブロックに渡して評価し、その結果が真になった要素をすべて削除します。
delete_if は常に self を返しますが、reject! は要素が 1 つ以上削除されれば self を、
1 つも削除されなければ nil を返します。
ブロックが与えられなかった場合は、自身と reject! から生成した
Enumerator オブジェクトを返します。
返された Enumerator オブジェクトの each メソッドには、
もとの配列に対して副作用があることに注意してください。
//emlist[例][ruby]{
a = [0, 1, 2, 3, 4, 5]
a.dele...