ライブラリ
- ビルトイン (411)
- bigdecimal (18)
-
bigdecimal
/ util (7) -
cgi
/ core (2) -
cgi
/ html (4) - csv (12)
- date (5)
- dbm (2)
- delegate (14)
- digest (3)
- drb (1)
- erb (3)
- fiddle (14)
-
fiddle
/ import (3) - forwardable (8)
- gdbm (2)
- getoptlong (7)
- ipaddr (2)
-
irb
/ cmd / help (1) -
irb
/ context (4) -
irb
/ ext / history (2) -
irb
/ ext / save-history (7) -
irb
/ extend-command (1) -
irb
/ frame (2) - json (10)
-
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 (8)
- matrix (51)
- mkmf (1)
- monitor (9)
-
net
/ ftp (5) -
net
/ http (6) -
net
/ imap (5) -
net
/ pop (1) -
net
/ smtp (9) - openssl (80)
- optparse (10)
- ostruct (2)
- pathname (73)
- prime (15)
- pstore (10)
- psych (10)
-
racc
/ parser (2) - rake (7)
-
rdoc
/ code _ object (1) -
rdoc
/ context (2) -
rdoc
/ generator / darkfish (1) -
rdoc
/ generator / ri (1) -
rdoc
/ markup (3) -
rdoc
/ markup / formatter (1) -
rdoc
/ parser / c (1) -
rdoc
/ parser / changelog (1) -
rdoc
/ parser / markdown (1) -
rdoc
/ parser / rd (1) -
rdoc
/ parser / ruby (1) -
rdoc
/ parser / simple (1) -
rdoc
/ top _ level (5) -
rexml
/ document (23) -
rexml
/ parsers / pullparser (1) -
ripper
/ filter (2) - rss (27)
-
rubygems
/ dependency _ list (1) -
rubygems
/ installer (1) -
rubygems
/ validator (3) - scanf (3)
- sdbm (4)
- set (2)
- shell (9)
-
shell
/ command-processor (7) -
shell
/ filter (10) - singleton (2)
- socket (7)
- stringio (11)
- tsort (5)
- un (2)
- uri (10)
- weakref (2)
-
webrick
/ httpauth / authenticator (1) -
webrick
/ httpresponse (5) -
webrick
/ log (6) -
win32
/ registry (9) - win32ole (15)
-
yaml
/ dbm (1) - zlib (8)
クラス
-
ARGF
. class (20) - Addrinfo (2)
- Array (79)
- BasicObject (4)
- BasicSocket (1)
- BigDecimal (21)
- Bignum (3)
-
CGI
:: Cookie (1) - CSV (6)
-
CSV
:: Row (1) -
CSV
:: Table (4) - Complex (8)
- DBM (2)
-
DRb
:: DRbServer (1) - Date (6)
- DateTime (1)
- Delegator (12)
-
Digest
:: Base (3) - Dir (1)
- ERB (3)
-
Encoding
:: Converter (4) - Enumerator (13)
-
Enumerator
:: Lazy (24) - Exception (2)
-
Fiddle
:: Function (2) -
Fiddle
:: Pointer (12) - File (1)
-
File
:: Stat (3) - Fixnum (2)
- Float (10)
- GDBM (2)
-
Gem
:: DependencyList (1) -
Gem
:: Installer (1) -
Gem
:: Validator (3) - GetoptLong (7)
- Hash (26)
- IO (21)
- IPAddr (2)
-
IRB
:: Context (11) -
IRB
:: ExtendCommand :: Help (1) -
IRB
:: Frame (2) - Integer (12)
- MatchData (7)
- Matrix (23)
-
Matrix
:: LUPDecomposition (1) - Method (2)
- Module (11)
- Monitor (1)
-
MonitorMixin
:: ConditionVariable (5) -
Net
:: FTP (5) -
Net
:: HTTP (2) -
Net
:: HTTPGenericRequest (2) -
Net
:: HTTPResponse (2) -
Net
:: IMAP (5) -
Net
:: POPMail (1) -
Net
:: SMTP (9) - Numeric (9)
- Object (21)
-
OpenSSL
:: ASN1 :: ASN1Data (1) -
OpenSSL
:: BN (11) -
OpenSSL
:: Netscape :: SPKI (2) -
OpenSSL
:: OCSP :: BasicResponse (1) -
OpenSSL
:: OCSP :: Request (1) -
OpenSSL
:: PKCS12 (1) -
OpenSSL
:: PKCS7 (1) -
OpenSSL
:: PKey :: EC (3) -
OpenSSL
:: PKey :: EC :: Group (5) -
OpenSSL
:: PKey :: EC :: Point (3) -
OpenSSL
:: SSL :: SSLContext (2) -
OpenSSL
:: SSL :: SSLSocket (2) -
OpenSSL
:: SSL :: Session (3) -
OpenSSL
:: X509 :: Attribute (1) -
OpenSSL
:: X509 :: CRL (4) -
OpenSSL
:: X509 :: Extension (1) -
OpenSSL
:: X509 :: ExtensionFactory (11) -
OpenSSL
:: X509 :: Name (2) -
OpenSSL
:: X509 :: Request (4) -
OpenSSL
:: X509 :: Store (13) -
OpenSSL
:: X509 :: StoreContext (6) - OpenStruct (3)
- OptionParser (7)
-
OptionParser
:: ParseError (2) - PStore (10)
- Pathname (72)
- Prime (4)
-
Prime
:: PseudoPrimeGenerator (10) - Proc (1)
-
Process
:: Status (3) -
Psych
:: Nodes :: Node (2) -
Psych
:: ScalarScanner (1) -
Psych
:: Visitors :: YAMLTree (5) -
RDoc
:: CodeObject (1) -
RDoc
:: Context (2) -
RDoc
:: Generator :: Darkfish (1) -
RDoc
:: Generator :: RI (1) -
RDoc
:: Markup (3) -
RDoc
:: Markup :: Formatter (1) -
RDoc
:: Options (1) -
RDoc
:: Parser :: C (1) -
RDoc
:: Parser :: ChangeLog (1) -
RDoc
:: Parser :: Markdown (1) -
RDoc
:: Parser :: RD (1) -
RDoc
:: Parser :: Ruby (1) -
RDoc
:: Parser :: Simple (1) -
RDoc
:: TopLevel (5) -
REXML
:: CData (2) -
REXML
:: Child (2) -
REXML
:: Element (7) -
REXML
:: Elements (6) -
REXML
:: Entity (2) -
REXML
:: Parent (1) -
REXML
:: Parsers :: PullParser (1) -
REXML
:: Text (2) -
RSS
:: Maker :: ChannelBase (4) -
RSS
:: Rss :: Channel (4) -
RSS
:: Rss :: Channel :: Cloud (2) -
RSS
:: TaxonomyTopicModel :: TaxonomyTopic (6) -
RSS
:: TaxonomyTopicsModel :: TaxonomyTopics (1) -
Racc
:: Parser (2) -
Rake
:: DefaultLoader (1) -
Rake
:: FileList (1) -
Rake
:: TaskArguments (3) - Random (3)
- Range (12)
- Rational (13)
- Regexp (5)
-
Ripper
:: Filter (2) -
RubyVM
:: InstructionSequence (1) - SDBM (4)
-
Scanf
:: FormatSpecifier (2) -
Scanf
:: FormatString (1) - Shell (9)
-
Shell
:: CommandProcessor (7) -
Shell
:: Filter (10) - SimpleDelegator (2)
- String (37)
- StringIO (11)
- Struct (2)
- Symbol (27)
- Thread (7)
-
Thread
:: Backtrace :: Location (3) - Time (1)
- TracePoint (1)
- UDPSocket (3)
- UNIXSocket (1)
-
URI
:: Generic (4) -
URI
:: MailTo (6) - UnboundMethod (2)
- Vector (27)
-
WEBrick
:: BasicLog (6) -
WEBrick
:: HTTPResponse (5) - WIN32OLE (2)
-
WIN32OLE
_ EVENT (1) -
WIN32OLE
_ METHOD (3) -
WIN32OLE
_ PARAM (2) -
WIN32OLE
_ TYPE (3) -
WIN32OLE
_ TYPELIB (2) -
WIN32OLE
_ VARIABLE (2) - WeakRef (2)
-
Win32
:: Registry (9) -
YAML
:: DBM (1) -
Zlib
:: GzipFile (2) -
Zlib
:: GzipReader (3) -
Zlib
:: GzipWriter (3)
モジュール
-
CGI
:: HtmlExtension (4) -
CGI
:: QueryExtension :: Value (2) - DublinCoreModel (6)
- Enumerable (38)
-
Fiddle
:: Importer (3) - Forwardable (4)
-
IRB
:: ExtendCommandBundle (1) -
IRB
:: HistorySavingAbility (2) -
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 (5)
- MonitorMixin (3)
-
OpenSSL
:: Buffering (1) -
OptionParser
:: Arguable (1) -
REXML
:: Node (1) -
RSS
:: RootElementMixin (1) -
RSS
:: TaxonomyTopicModel (2) -
RSS
:: TaxonomyTopicsModel (1) -
Rake
:: TaskManager (1) - SingleForwardable (4)
- Singleton (2)
- TSort (5)
-
WEBrick
:: HTTPAuth :: Authenticator (1)
キーワード
- != (1)
- % (2)
- & (2)
- * (5)
- + (2)
- +@ (2)
- - (2)
- -@ (2)
-
/ (1) - << (9)
- <=> (2)
- == (5)
- === (1)
- =~ (1)
- > (1)
- >> (3)
- Pathname (1)
- [] (17)
- []= (9)
-
_ _ getobj _ _ (3) -
_ _ setobj _ _ (3) - abort (1)
- about (1)
- about= (1)
-
absolute
_ path (1) - add (1)
-
add
_ cert (1) -
add
_ class _ or _ module (1) -
add
_ crl (1) -
add
_ element (1) -
add
_ file (1) -
add
_ html (1) -
add
_ namespace (2) -
add
_ path (1) -
add
_ special (1) -
add
_ tag (1) -
add
_ to (1) -
add
_ trace _ func (1) -
add
_ word _ pair (1) - ancestors (1)
-
angle
_ with (1) - append (4)
- at (1)
- atime (2)
-
auto
_ indent _ mode (1) -
auto
_ indent _ mode= (1) - autoclose= (1)
- autoclose? (1)
- autoload (1)
- autoload? (1)
-
backtrace
_ locations (2) - basename (1)
- begin (1)
- bind (1)
- binread (1)
- binwrite (1)
- birthtime (1)
- blockdev? (1)
- body= (1)
-
body
_ stream (1) -
body
_ stream= (1) - bottom (1)
- broadcast (1)
- bsearch (2)
-
bsearch
_ index (1) - bytes (4)
- call (1)
- capitalize (1)
- captures (1)
- casecmp (1)
- cat (3)
- ceil (3)
-
cert
_ store (2) -
cert
_ store= (2) - chardev? (1)
- chars (4)
- children (1)
- chmod (2)
- chown (1)
- chunk (3)
-
chunk
_ while (1) - chunked= (1)
- clone (2)
- closed? (1)
- codepoints (4)
- coerce (2)
- cofactor (2)
-
cofactor
_ expansion (1) -
col
_ sep (1) - collect (4)
- collect! (1)
- collect2 (2)
-
collect
_ concat (1) - column (1)
- combination (2)
- commit (1)
- component (1)
- config= (1)
-
connect
_ to (2) -
content
_ length (1) -
content
_ length= (1) -
create
_ ext (1) -
create
_ ext _ from _ array (1) -
create
_ ext _ from _ hash (1) -
create
_ ext _ from _ string (1) -
create
_ extension (2) -
create
_ makefile (1) -
create
_ rule (1) - crl= (1)
- cross (1)
-
cross
_ product (1) - ctime (2)
- cycle (3)
- date (1)
- date= (1)
-
dc
_ contributor (1) -
dc
_ contributor= (1) -
dc
_ contributors (1) -
dc
_ creator (1) -
dc
_ creator= (1) -
dc
_ creators (1) - debug (1)
-
def
_ delegator (2) -
def
_ delegators (2) -
def
_ instance _ delegator (1) -
def
_ instance _ delegators (1) -
def
_ single _ delegator (1) -
def
_ single _ delegators (1) -
default
_ proc= (1) -
define
_ singleton _ method (2) - delete (3)
-
delete
_ all (1) -
delete
_ at (1) -
delete
_ element (1) -
delete
_ if (5) -
delete
_ namespace (1) - denominator (5)
-
descriptor
_ length (1) - detect (1)
- directory (1)
- directory? (5)
- dirname (1)
- dot (1)
- downcase (1)
- downto (4)
- drop (1)
-
drop
_ while (2) - dup (2)
- each (20)
- each2 (2)
-
each
_ byte (6) -
each
_ char (4) -
each
_ child (2) -
each
_ codepoint (3) -
each
_ cons (1) -
each
_ entry (2) -
each
_ index (1) -
each
_ key (1) -
each
_ line (11) -
each
_ option (1) -
each
_ pair (1) -
each
_ slice (1) -
each
_ strongly _ connected _ component (1) -
each
_ strongly _ connected _ component _ from (1) -
each
_ value (1) -
each
_ with _ index (4) -
each
_ with _ object (1) - echo (3)
- eigen (1)
- eigensystem (1)
- element (1)
-
enable
_ starttls _ auto (1) - end (1)
- entries (1)
-
enum
_ for (2) - eql? (2)
- error (2)
- error= (1)
-
eval
_ history (1) -
eval
_ history= (1) - executable? (1)
-
executable
_ real? (1) - execute (1)
- exist? (1)
- exit (1)
- extname (1)
- fatal (1)
- feed (1)
- fetch (4)
- file (1)
- file? (1)
-
file
_ absolute _ name= (1) -
file
_ relative _ name= (1) -
file
_ stat= (1) - fileno (2)
- find (3)
-
find
_ all (2) -
find
_ index (5) -
find
_ module _ named (1) - finish (1)
- first (4)
- flags= (2)
-
flat
_ map (1) - flatten (1)
- flatten! (1)
- flock (1)
- floor (3)
- fnmatch (1)
- fnmatch? (1)
- freeze (1)
- ftype (1)
- generator (2)
- generator= (3)
-
get
_ elements (1) - getopts (3)
- glob (3)
- grep (1)
-
grep
_ v (1) - grpowned? (1)
- gsub (1)
- gsub! (1)
- handler= (1)
-
header
_ convert (3) -
header
_ converters (1) - headers (1)
- headers= (1)
- helpstring (1)
- hex (1)
- hexdigest (1)
-
history
_ file (1) -
history
_ file= (1) - hostname= (1)
- httopnly= (1)
- id2name (1)
- independent? (1)
- index (4)
- infinity? (1)
- info (1)
-
init
_ save _ history (1) - initialize (2)
-
inner
_ product (1) - insert (1)
-
insert
_ output (1) - inspect (14)
- inspect? (1)
-
inspect
_ mode= (1) -
install
_ alias _ method (1) -
instance
_ methods (1) - intern (1)
- io (1)
-
issuer
_ certificate= (1) - join (1)
- kconv (1)
-
keep
_ if (2) - keys (1)
-
laplace
_ expansion (1) - last (4)
- lazy (1)
- lchmod (1)
- lchown (1)
- length (1)
- lines (9)
- load (1)
-
load
_ history (1) - lshift! (1)
- lstat (1)
- lup (1)
-
lup
_ decomposition (1) - magnitude (1)
-
make
_ link (1) -
make
_ symlink (1) - managingEditor (2)
- managingEditor= (2)
- map (4)
- map! (1)
- map2 (1)
-
marshal
_ load (1) -
mask
_ bits! (1) - match (3)
-
max
_ by (4) -
max
_ key _ length (1) -
max
_ value _ length (1) -
max
_ value _ name _ length (1) - merge (2)
- merge! (3)
-
method
_ missing (2) - methods (1)
-
min
_ by (2) -
minmax
_ by (1) - minor (2)
- mkdir (1)
- mkpath (1)
-
mod
_ inverse (1) - modulo (1)
-
mon
_ exit (1) -
mon
_ synchronize (1) - mtime (1)
- name (7)
- next (3)
-
next
_ float (1) -
next
_ sibling= (1) -
next
_ token (1) -
next
_ values (1) - norm (1)
- normalize (1)
-
num
_ keys (1) -
num
_ values (1) - numerator (5)
- oct (1)
-
ok
_ to _ remove? (1) -
ole
_ query _ interface (1) -
ole
_ respond _ to? (1) -
on
_ XXX (1) -
on
_ default (1) - open (2)
- opendir (2)
- ordering= (1)
- owned? (1)
- pack (1)
- path (1)
- peek (1)
-
peek
_ values (1) - permutation (2)
- pipe? (1)
- pop (2)
- prepended (1)
-
pretty
_ print (1) -
prev
_ float (1) -
previous
_ sibling= (1) - prime? (1)
-
prime
_ division (2) -
primitive
_ errinfo (1) - print (1)
-
private
_ instance _ methods (1) -
program
_ name (1) -
program
_ name= (1) -
protected
_ instance _ methods (1) -
protected
_ methods (1) - protocol (1)
- protocol= (1)
-
psych
_ to _ yaml (1) - ptr (1)
-
public
_ instance _ methods (1) -
public
_ method (1) -
public
_ methods (1) - purpose= (2)
- push (1)
- putback (2)
- putc (1)
- quiet= (1)
- r (1)
- rand (3)
- rationalize (2)
- rcptto (1)
-
rcptto
_ list (1) - read (1)
-
read
_ body (2) - readable? (1)
-
readable
_ real? (1) - readlines (4)
- readlink (1)
- ready (1)
-
record
_ separator (1) -
record
_ separator= (1) - ref (1)
- reject (8)
- reject! (3)
-
relative
_ path _ from (1) - remainder (1)
- rename (5)
-
repeated
_ combination (2) -
repeated
_ permutation (2) - replace (3)
-
replace
_ child (1) - resources (1)
-
respond
_ to? (2) -
respond
_ to _ missing? (2) - result (1)
-
reverse
_ each (1) - rewind (2)
- rindex (1)
- rmdir (1)
- rmtree (1)
- root? (1)
- roots (1)
- rotate (1)
- rotate! (1)
- round (4)
-
route
_ to (1) - row (1)
- rshift! (1)
- run (1)
- sample (4)
-
save
_ history (2) -
save
_ history= (1) - scan (6)
- select (5)
- select! (2)
- send (3)
-
send
_ io (1) -
send
_ mail (1) - sendmail (1)
- separator (1)
-
set
_ backtrace (1) -
set
_ default _ paths (1) -
set
_ error (1) -
set
_ generator (1) -
set
_ to _ infinity! (1) -
set
_ trace _ func (1) -
set
_ visibility _ for (1) - setgid? (1)
- setsockopt (1)
- setuid? (1)
- shift (2)
- signal (1)
-
singleton
_ class (1) -
singleton
_ method (1) -
singleton
_ method _ added (1) -
singleton
_ method _ removed (1) -
singleton
_ method _ undefined (1) -
singleton
_ methods (1) - size (3)
- size? (1)
- sizeof (1)
- slice (5)
-
slice
_ after (4) -
slice
_ before (5) -
slice
_ when (2) - socket? (1)
- solve (1)
- sort (3)
- sort! (2)
-
sort
_ by (1) -
sort
_ by! (1) -
source
_ location (1) - split (2)
- src (1)
- start (1)
-
starttls
_ auto? (1) - stat (1)
- step (8)
- sticky? (1)
- stop? (1)
-
stop
_ doc (1) -
stop
_ service (1) - storbinary (2)
- store (6)
- storlines (2)
- struct (1)
-
subject
_ certificate= (1) -
subject
_ request= (1) - succ (2)
- summarize (2)
- swapcase (1)
- symlink? (1)
- synchronize (1)
- sysopen (1)
- syswrite (1)
- take (1)
-
take
_ while (4) -
taxo
_ link (1) -
taxo
_ link= (1) -
taxo
_ topic (1) -
taxo
_ topic= (1) -
taxo
_ topics (1) - tee (3)
- terminate (1)
- text= (1)
- time= (2)
- times (1)
- to= (1)
-
to
_ a (11) -
to
_ ary (3) -
to
_ binary (1) -
to
_ bn (2) -
to
_ c (1) -
to
_ csv (1) -
to
_ d (6) -
to
_ der (9) -
to
_ digits (1) -
to
_ enum (2) -
to
_ f (4) -
to
_ h (1) -
to
_ hash (1) -
to
_ i (9) -
to
_ int (3) -
to
_ io (4) -
to
_ json (21) -
to
_ json _ raw (1) -
to
_ mailtext (1) -
to
_ path (1) -
to
_ pem (6) -
to
_ proc (1) -
to
_ r (3) -
to
_ re (1) -
to
_ rfc822text (1) -
to
_ s (39) -
to
_ set (2) -
to
_ str (3) -
to
_ string (1) -
to
_ sym (1) -
to
_ text (5) -
to
_ xml (1) -
to
_ yaml (2) - toeuc (1)
- tojis (1)
-
token
_ to _ str (1) - tokenize (1)
- tolocale (1)
- top (2)
- tosjis (1)
- touch (1)
- toutf16 (1)
- toutf32 (1)
- toutf8 (1)
- transaction (1)
- tree (1)
- truncate (5)
- trust= (2)
-
tsort
_ each (1) -
tsort
_ each _ child (1) -
tsort
_ each _ node (1) -
uid
_ sort (1) -
uid
_ store (1) -
ultra
_ safe= (1) -
unit
_ test (1) - unpack (2)
- unshift (1)
- upcase (1)
- update (3)
-
upper
_ bound= (1) - upto (5)
- userdb (1)
- userinfo= (1)
- utime (1)
- value (2)
- values (1)
-
values
_ at (2) - verify (5)
-
verify
_ callback (1) -
verify
_ callback= (1) -
verify
_ gem (1) -
verify
_ gem _ file (1) - wait (1)
-
wait
_ until (1) -
wait
_ while (1) - warn (1)
-
with
_ defaults (1) -
with
_ index (2) -
with
_ object (4) -
world
_ readable? (1) -
world
_ writable? (1) - writable? (1)
-
writable
_ real? (1) - write (6)
- wtime (1)
- yaml (1)
- zero? (1)
- zip (6)
- | (2)
検索結果
先頭5件
-
URI
:: MailTo # to -> String (63361.0) -
自身の e-mail アドレスを文字列で返します。
自身の e-mail アドレスを文字列で返します。
例:
require 'uri'
p URI.parse("mailto:nospam@example.com").to #=> "nospam@example.com" -
Racc
:: Parser # token _ to _ str(t) (36655.0) -
@todo
@todo -
JSON
:: Generator :: GeneratorMethods :: Object # to _ json(state _ or _ hash = nil) -> String (36463.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 :: String # to _ json _ raw -> String (36457.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 :: String # to _ json(state _ or _ hash = nil) -> String (36397.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]... -
JSON
:: Generator :: GeneratorMethods :: Array # to _ json(state _ or _ hash = nil) -> String (36343.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 (36343.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 (36343.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 (36343.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 (36343.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 (36343.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 :: TrueClass # to _ json(state _ or _ hash = nil) -> String (36343.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//} -
URI
:: MailTo # to=(s) (27415.0) -
自身の e-mail アドレスを文字列で設定します。
自身の e-mail アドレスを文字列で設定します。
@param s 自身の e-mail アドレスを文字列で指定します。
@raise URI::InvalidComponentError 不正な引数 s に対して発生します。
例:
require 'uri'
m = URI.parse("mailto:nospam@example.com")
m.to = "nospaaaam@example.com"
p m #=> #<URI::MailTo:0xb7bf0614 URL:mailt... -
URI
:: MailTo # to _ mailtext -> String (27400.0) -
URI オブジェクトからメールテキスト文字列を生成します。
URI オブジェクトからメールテキスト文字列を生成します。
例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext
=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org
Sub... -
URI
:: MailTo # to _ rfc822text -> String (27400.0) -
URI オブジェクトからメールテキスト文字列を生成します。
URI オブジェクトからメールテキスト文字列を生成します。
例:
require 'uri'
p mailto = URI.parse("mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr")
print mailto.to_mailtext
=> #<URI::MailTo:0x20104a0e URL:mailto:ruby-list@ruby-lang.org?subject=subscribe&cc=myaddr>
To: ruby-list@ruby-lang.org
Sub... -
Delegator
# respond _ to _ missing?(m , include _ private) -> bool (27373.0) -
@param m メソッド名を指定します。
@param m メソッド名を指定します。
@param include_private 真を指定すると private メソッドも調べます。 -
Delegator
# respond _ to?(m) -> bool (27361.0) -
Delegator#__getobj__ が返すオブジェクトが メソッド m を持つとき真を返します。
Delegator#__getobj__ が返すオブジェクトが メソッド m を持つとき真を返します。
@param m メソッド名
@see Object#respond_to? -
RSS
:: TaxonomyTopicModel # taxo _ topic (27352.0) -
@todo
@todo -
RSS
:: TaxonomyTopicModel # taxo _ topic= (27352.0) -
@todo
@todo -
RSS
:: TaxonomyTopicsModel # taxo _ topics (27352.0) -
@todo
@todo -
Delegator
# _ _ setobj _ _ (obj) -> object (27340.0) -
委譲先のオブジェクトをセットします。
委譲先のオブジェクトをセットします。
@param obj 委譲先のオブジェクトを指定します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。 -
SimpleDelegator
# _ _ setobj _ _ (obj) -> object (27340.0) -
委譲先のオブジェクトを obj に変更します。
委譲先のオブジェクトを obj に変更します。
メソッド委譲を行うためのクラスメソッドの再定義は行われないことに注意してください。
メソッド委譲を行うためのクラスメソッドの定義は生成時にのみ行われます。
そのため、以前の委譲先オブジェクトと
obj の間で呼び出せるメソッドに違いがあった場合は、
何かしらの例外が発生する可能性があります。
@param obj 委譲先のオブジェクト
@return 変更後の委譲先オブジェクト -
Delegator
# _ _ getobj _ _ -> object (27322.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
本メソッドは、サブクラスで再定義する必要があり、
デフォルトでは NotImplementedError が発生します。
@raise NotImplementedError サブクラスにて本メソッドが再定義されていない場合に発生します。 -
IRB
:: HistorySavingAbility # load _ history -> () (27322.0) -
irb のヒストリを履歴ファイルから読み込みます。
irb のヒストリを履歴ファイルから読み込みます。
@see lib:irb#history -
IRB
:: HistorySavingAbility # save _ history -> () (27322.0) -
irb のヒストリを履歴ファイルに保存します。
irb のヒストリを履歴ファイルに保存します。
@see lib:irb#history -
SimpleDelegator
# _ _ getobj _ _ -> object (27322.0) -
委譲先のオブジェクトを返します。
委譲先のオブジェクトを返します。
@see Delegator#__getobj__ -
Vector
# +@ -> self (27304.0) -
単項演算子の + です。 self を返します。
単項演算子の + です。 self を返します。 -
Vector
# -@ -> self (27304.0) -
単項演算子の - です。 各要素の符号を反転したベクトルを返します。
単項演算子の - です。 各要素の符号を反転したベクトルを返します。 -
OpenSSL
:: PKey :: EC :: Group # set _ generator(generator , order , cofactor) -> self (18976.0) -
群のパラメータを設定します。
群のパラメータを設定します。
@param generator 生成元(OpenSSL::PKey::EC::Point オブジェクト)
@param order 生成元の位数(OpenSSL::BN オブジェクト)
@param cofactor 余因子OpenSSL::BN オブジェクト
@raise OpenSSL::PKey::EC::Group::Error 設定に失敗した場合に発生します -
OpenSSL
:: BN # to _ s(base=10) -> String (18865.0) -
自身を表す文字列を返します。
自身を表す文字列を返します。
base で、変換方法(基数)を指定します。
デフォルトは 10 で、他に 16, 2, 0 を指定できます。
10 10進数の表記
16 16進数の表記
2 big-endianの符号無し整数のバイナリ列
0 MPI形式の文字列(バイト列)
@param base 文字列への変換方法(基数)
@raise OpenSSL::BNError 変換に失敗した場合に発生します
//emlist[][ruby]{
require 'openssl'
p 10.to_bn.to_s # => "10"
p (-5).to_bn.... -
String
# to _ i(base = 10) -> Integer (18703.0) -
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
文字列を 10 進数表現された整数であると解釈して、整数に変換します。
//emlist[例][ruby]{
p " 10".to_i # => 10
p "+10".to_i # => 10
p "-10".to_i # => -10
p "010".to_i # => 10
p "-010".to_i # => -10
//}
整数とみなせない文字があればそこまでを変換対象とします。
変換対象が空文字列であれば 0 を返します。
//emlist[例][ruby]{
p "0x11".to_i # => 0
p "".to_i # =>... -
Net
:: SMTP # rcptto _ list(to _ addrs) { . . . } -> object (18691.0) -
RCPTTO コマンドを to_addrs のすべてのメールアドレスに対して送ります。
RCPTTO コマンドを to_addrs のすべてのメールアドレスに対して送ります。
コマンドを送った後、ブロックを呼び出します。
このメソッドの返り値はブロックの返り値になります。
通常は Net::SMTP#send_message, Net::SMTP#open_message_stream で
RCPTTO が送られるため利用する必要はないはずです。
@param to_addrs 送信先メールアドレスの配列 -
Integer
# downto(min) -> Enumerator (18658.0) -
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。 self < min であれば何もしません。
self から min まで 1 ずつ減らしながらブロックを繰り返し実行します。
self < min であれば何もしません。
@param min 数値
@return self を返します。
//emlist[][ruby]{
5.downto(1) {|i| print i, " " } # => 5 4 3 2 1
//}
@see Integer#upto, Numeric#step, Integer#times -
Integer
# upto(max) -> Enumerator (18658.0) -
self から max まで 1 ずつ増やしながら繰り返します。 self > max であれば何もしません。
self から max まで 1 ずつ増やしながら繰り返します。
self > max であれば何もしません。
@param max 数値
@return self を返します。
//emlist[][ruby]{
5.upto(10) {|i| print i, " " } # => 5 6 7 8 9 10
//}
@see Integer#downto, Numeric#step, Integer#times -
Net
:: SMTP # rcptto(to _ addr) -> Net :: SMTP :: Response (18643.0) -
RCPTTO コマンドを送ります。
RCPTTO コマンドを送ります。
通常は Net::SMTP#send_message, Net::SMTP#open_message_stream で
RCPTTO が送られるため利用する必要はないはずです。
@param to_addr 送信先メールアドレス -
Date
# downto(min) -> Enumerator (18640.0) -
このメソッドは、step(min, -1){|date| ...} と等価です。
このメソッドは、step(min, -1){|date| ...} と等価です。
@param min 日付オブジェクト
@see Date#step, Date#upto -
Date
# upto(max) -> Enumerator (18640.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto -
Object
# singleton _ methods(inherited _ too = true) -> [Symbol] (18640.0) -
そのオブジェクトに対して定義されている特異メソッド名 (public あるいは protected メソッド) の一覧を返します。
そのオブジェクトに対して定義されている特異メソッド名
(public あるいは protected メソッド) の一覧を返します。
inherited_too が真のときは継承した特異メソッドを含みます。
継承した特異メソッドとは Object#extend によって追加された特異メソッドや、
self がクラスの場合はスーパークラスのクラスメソッド(Classのインスタンスの特異メソッド)などです。
singleton_methods(false) は、Object#methods(false) と同じです。
@param inherited_too 継承した特異メソッドを含める場合は... -
OpenSSL
:: SSL :: SSLContext # cert _ store=(store) (18640.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを設定します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを設定します。
通常は OpenSSL::SSL::SSLContext#ca_path= や
OpenSSL::SSL::SSLContext#ca_file= で証明書を設定しますが、
CRL を使いたいなど、より詳細な設定をしたい場合にはこれを使います。
デフォルトは nil (証明書ストアを指定しない)です。
@param store 設定する証明書ストア(OpenSSL::X509::Store のインスタンス)
@see OpenSSL::SSL::SSLContext#cert_store -
Net
:: HTTP # cert _ store -> OpenSSL :: X509 :: Store | nil (18622.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを返します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを返します。
@see Net::HTTP#cert_store, OpenSSL::SSL::SSLContext#cert_store= -
Net
:: HTTP # cert _ store=(store) (18622.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを設定します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを設定します。
通常は Net::HTTP#ca_file= や Net::HTTP#ca_path= で
設定しますが、より詳細な設定をしたい場合にはこちらを用います。
デフォルトは nil (証明書ストアを指定しない)です。
@see Net::HTTP#cert_store=, OpenSSL::SSL::SSLContext#cert_store -
OpenSSL
:: SSL :: SSLContext # cert _ store -> OpenSSL :: X509 :: Store | nil (18622.0) -
接続相手の証明書の検証のために使う、信頼している CA 証明書を 含む証明書ストアを返します。
接続相手の証明書の検証のために使う、信頼している CA 証明書を
含む証明書ストアを返します。
デフォルトは nil です。
@see OpenSSL::SSL::SSLContext#cert_store= -
String
# to _ c -> Complex (18613.0) -
自身を複素数 (Complex) に変換した結果を返します。
自身を複素数 (Complex) に変換した結果を返します。
以下の形式を解析できます。i、j は大文字、小文字のどちらでも解析できます。
* 実部+虚部i
* 実部+虚部j
* 絶対値@偏角
それぞれの数値は以下のいずれかの形式で指定します。先頭の空白文字や複素
数値の後にある文字列は無視されます。また、数値オブジェクトと同様に各桁
の間に「_」を入れる事ができます。
* "1/3" のような分数の形式
* "0.3" のような10進数の形式
* "0.3E0" のような x.xEn の形式
自身が解析できない値であった場合は 0+0i を返します。
//emlis... -
String
# to _ f -> Float (18577.0) -
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
文字列を 10 進数表現と解釈して、浮動小数点数 Float に変換します。
浮動小数点数とみなせなくなるところまでを変換対象とします。
途中に変換できないような文字列がある場合、それより先の文字列は無視されます。
//emlist[][ruby]{
p "-10".to_f # => -10.0
p "10e2".to_f # => 1000.0
p "1e-2".to_f # => 0.01
p ".1".to_f # => 0.1
p "1_0_0".to_f # => 100.0 # 数値リテラルと同じように区切りに _ を使える
p " \n10".to_f ... -
Object
# respond _ to _ missing?(symbol , include _ private) -> bool (18541.0) -
自身が symbol で表されるメソッドに対し BasicObject#method_missing で反応するつもりならば真を返します。
自身が symbol で表されるメソッドに対し
BasicObject#method_missing で反応するつもりならば真を返します。
Object#respond_to? はメソッドが定義されていない場合、
デフォルトでこのメソッドを呼びだし問合せます。
BasicObject#method_missing を override した場合にこのメソッドも
override されるべきです。
false を返します。
@param symbol メソッド名シンボル
@param include_private private method も含めたい場合に true が渡されます... -
String
# to _ r -> Rational (18523.0) -
自身を有理数(Rational)に変換した結果を返します。
自身を有理数(Rational)に変換した結果を返します。
Kernel.#Rational に文字列を指定した時のように、以下のいずれかの形
式で指定します。
* "1/3" のような分数の形式
* "0.3" のような10進数の形式
* "0.3E0" のような x.xEn の形式
* 数字をアンダースコアで繋いだ形式
//emlist[例][ruby]{
' 2 '.to_r # => (2/1)
'1/3'.to_r # => (1/3)
'-9.2'.to_r # => (-46/5)
'-9.2E2'.to_r ... -
BigDecimal
# to _ s -> String (18508.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.123456... -
BigDecimal
# to _ s(n) -> String (18508.0) -
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
self を文字列に変換します (デフォルトは "0.xxxxxen" の形になります)。
@param n 出力の形式を Integer または String で指定します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1.23456").to_s # ==> "0.123456e1"
//}
引数 n に正の整数が指定されたときは、小数点で分けられる左右部分を、
それぞれ n 桁毎に空白で区切ります。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("0.123456... -
OpenSSL
:: X509 :: Name # to _ s(flags=nil) -> String (18505.0) -
DNの文字列表現を返します。
DNの文字列表現を返します。
flags には通常は以下のいずれかを渡します。
* nil
* OpenSSL::X509::Name::COMPAT
* OpenSSL::X509::Name::RFC2253
* OpenSSL::X509::Name::ONELINE
* OpenSSL::X509::Name::MULTILINE
*
例:
require 'openssl'
n = OpenSSL::X509::Name.parse('/C=JP/ST=Kanagawa/L=Yokohama/O=Example Company/OU=Lab3/CN... -
Enumerable
# to _ set(klass = Set , *args) -> Set (18472.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
引数 klass を与えた場合、Set クラスの代わりに、指定した集合クラスの
インスタンスを作ります。
この引数を指定することで、SortedSet あるいはその他のユーザ定義の
集合クラスのインスタンスを作ることができます
(ここでいう集合クラスとは、Setとメソッド/クラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラ... -
Enumerable
# to _ set(klass = Set , *args) {|o| . . . } -> Set (18472.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
引数 klass を与えた場合、Set クラスの代わりに、指定した集合クラスの
インスタンスを作ります。
この引数を指定することで、SortedSet あるいはその他のユーザ定義の
集合クラスのインスタンスを作ることができます
(ここでいう集合クラスとは、Setとメソッド/クラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラ... -
Object
# respond _ to?(name , include _ all = false) -> bool (18469.0) -
オブジェクトがメソッド name を持つとき真を返します。
オブジェクトがメソッド name を持つとき真を返します。
オブジェクトが メソッド name を持つというのは、
オブジェクトが メソッド name に応答できることをいいます。
Windows での Process.fork や GNU/Linux での File.lchmod の
ような NotImplementedError が発生する場合は false を返します。
※ NotImplementedError が発生する場合に false を返すのは
Rubyの組み込みライブラリや標準ライブラリなど、C言語で実装されているメソッドのみです。
Rubyで実装されたメソッドで N... -
Rational
# to _ f -> Float (18469.0) -
自身の値を最も良く表現する Float に変換します。
自身の値を最も良く表現する Float に変換します。
絶対値が極端に小さい、または大きい場合にはゼロや無限大が返ることがあります。
@return Float を返します。
//emlist[例][ruby]{
Rational(2).to_f # => 2.0
Rational(9, 4).to_f # => 2.25
Rational(-3, 4).to_f # => -0.75
Rational(20, 3).to_f # => 6.666666666666667
Rational(1, 10**1000... -
Rational
# to _ i -> Integer (18469.0) -
小数点以下を切り捨てて値を整数に変換します。
小数点以下を切り捨てて値を整数に変換します。
@param precision 計算結果の精度
@raise TypeError precision に整数以外のものを指定すると発生します。
//emlist[例][ruby]{
Rational(2, 3).to_i # => 0
Rational(3).to_i # => 3
Rational(300.6).to_i # => 300
Rational(98, 71).to_i # => 1
Rational(-31, 2).to_i # => -15
//}
precision を指定した場合は指定した桁数で切り... -
Net
:: FTP # storbinary(cmd , file , blocksize , rest _ offset = nil) -> nil (18466.0) -
サーバーに cmd で指定されたコマンドを送り、バイナリデータを 送ります。
サーバーに cmd で指定されたコマンドを送り、バイナリデータを
送ります。
送るデータは IO のインスタンスを
file で指定します。
(実際には StringIO のような IO とメソッドレベルで
互換するオブジェクトであればなんでもかまいません)。
blocksize で指定されたバイト単位で file からデータを読みこみ、
サーバに送ります。
rest_offset が省略されなかった場合は、cmdを送る前に
REST コマンドを送り、指定したバイト数の位置から
転送を開始します。
ブロックが指定された場合には、転送するデータを blocksize ごとに
ブロックに... -
Net
:: FTP # storbinary(cmd , file , blocksize , rest _ offset = nil) {|data| . . . } -> nil (18466.0) -
サーバーに cmd で指定されたコマンドを送り、バイナリデータを 送ります。
サーバーに cmd で指定されたコマンドを送り、バイナリデータを
送ります。
送るデータは IO のインスタンスを
file で指定します。
(実際には StringIO のような IO とメソッドレベルで
互換するオブジェクトであればなんでもかまいません)。
blocksize で指定されたバイト単位で file からデータを読みこみ、
サーバに送ります。
rest_offset が省略されなかった場合は、cmdを送る前に
REST コマンドを送り、指定したバイト数の位置から
転送を開始します。
ブロックが指定された場合には、転送するデータを blocksize ごとに
ブロックに... -
Float
# to _ d -> BigDecimal (18454.0) -
自身を BigDecimal に変換します。
自身を BigDecimal に変換します。
@param prec 計算結果の精度。省略した場合は Float::DIG + 1 です。
@return BigDecimal に変換したオブジェクト
//emlist[][ruby]{
require 'bigdecimal'
require 'bigdecimal/util'
p 1.0.to_d # => 0.1e1
p (1.0 / 0).to_d # => Infinity
p (1.0 / 3).to_d / (2.0 / 3).to_d # => 0.5e0
p ((1.0 / 3) / (2.0 / 3... -
Float
# to _ d(prec) -> BigDecimal (18454.0) -
自身を BigDecimal に変換します。
自身を BigDecimal に変換します。
@param prec 計算結果の精度。省略した場合は Float::DIG + 1 です。
@return BigDecimal に変換したオブジェクト
//emlist[][ruby]{
require 'bigdecimal'
require 'bigdecimal/util'
p 1.0.to_d # => 0.1e1
p (1.0 / 0).to_d # => Infinity
p (1.0 / 3).to_d / (2.0 / 3).to_d # => 0.5e0
p ((1.0 / 3) / (2.0 / 3... -
Exception
# to _ json(*args) -> String (18451.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... -
Object
# singleton _ method(name) -> Method (18448.0) -
オブジェクトの特異メソッド name をオブジェクト化した Method オブ ジェクトを返します。
オブジェクトの特異メソッド name をオブジェクト化した Method オブ
ジェクトを返します。
@param name メソッド名をSymbol またはStringで指定します。
@raise NameError 定義されていないメソッド名を引数として与えると発生します。
//emlist[][ruby]{
class Demo
def initialize(n)
@iv = n
end
def hello()
"Hello, @iv = #{@iv}"
end
end
k = Demo.new(99)
def k.hi
"Hi, @iv = ... -
Net
:: FTP # storlines(cmd , file) -> nil (18430.0) -
サーバーに cmd で指定されたコマンドを送り、テキストデータを 送ります。
サーバーに cmd で指定されたコマンドを送り、テキストデータを
送ります。
一行ずつで file からテキストを読み込み、サーバーに送ります。
送るデータは IO のインスタンスを
file で指定します。
(実際には StringIO のような IO とメソッドレベルで
互換するオブジェクトであればなんでもかまいません)。
ブロックが与えられた場合には各行をそのブロックに渡します。
@param cmd コマンドを文字列で与えます。
@param file 送るデータを与えます。
@raise Net::FTPTempError 応答コードが 4yz のときに発生します。
@ra... -
Net
:: FTP # storlines(cmd , file) {|line| . . . } -> nil (18430.0) -
サーバーに cmd で指定されたコマンドを送り、テキストデータを 送ります。
サーバーに cmd で指定されたコマンドを送り、テキストデータを
送ります。
一行ずつで file からテキストを読み込み、サーバーに送ります。
送るデータは IO のインスタンスを
file で指定します。
(実際には StringIO のような IO とメソッドレベルで
互換するオブジェクトであればなんでもかまいません)。
ブロックが与えられた場合には各行をそのブロックに渡します。
@param cmd コマンドを文字列で与えます。
@param file 送るデータを与えます。
@raise Net::FTPTempError 応答コードが 4yz のときに発生します。
@ra... -
Object
# psych _ to _ yaml(options = {}) -> String (18418.0) -
オブジェクトを YAML document に変換します。
オブジェクトを YAML document に変換します。
options でオプションを指定できます。
Psych.dump と同じなので詳しくはそちらを参照してください。
syck に to_yaml メソッドがあるため、
psych_to_yaml が別名として定義されています。将来的に
syck が廃止された場合 psych_to_yaml は廃止
される予定であるため、特別の事情がない限り to_yaml を用いてください。
@param options 出力オプション
@see Psych.dump -
Object
# to _ yaml(options = {}) -> String (18418.0) -
オブジェクトを YAML document に変換します。
オブジェクトを YAML document に変換します。
options でオプションを指定できます。
Psych.dump と同じなので詳しくはそちらを参照してください。
syck に to_yaml メソッドがあるため、
psych_to_yaml が別名として定義されています。将来的に
syck が廃止された場合 psych_to_yaml は廃止
される予定であるため、特別の事情がない限り to_yaml を用いてください。
@param options 出力オプション
@see Psych.dump -
Array
# to _ a -> Array (18415.0) -
self を返します。ただし、Array のサブクラスのインスタンスに対して呼ばれた時は、 自身を Array に変換したものを返します。
self を返します。ただし、Array のサブクラスのインスタンスに対して呼ばれた時は、
自身を Array に変換したものを返します。
//emlist[例][ruby]{
class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])
ary1.to_a # => [1, 2, 3, 4]
ary1.to_a.class # => Array
ary2.to_a # => [1, 2, 3, 4]
ary2.to_a.class # => Ar... -
Array
# to _ ary -> self (18415.0) -
self をそのまま返します。
self をそのまま返します。
//emlist[例][ruby]{
class SubArray < Array; end
ary1 = Array([1, 2, 3, 4])
ary2 = SubArray([1, 2, 3, 4])
ary1.to_ary # => [1, 2, 3, 4]
ary1.to_ary.class # => Array
ary2.to_ary # => [1, 2, 3, 4]
ary2.to_ary.class # => SubArray
//}
@see Array#to_a -
Date
# to _ json(*args) -> String (18415.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 (18415.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,\"... -
Range
# to _ json(*args) -> String (18415.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 _ s -> String (18415.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
"3/5", "-17/7" のように10進数の表記を返します。
@return 有理数の表記にした文字列を返します。
//emlist[例][ruby]{
Rational(3, 4).to_s # => "3/4"
Rational(8).to_s # => "8/1"
Rational(-8, 6).to_s # => "-4/3"
Rational(0.5).to_s # => "1/2"
//}
@see Rational#inspect -
Struct
# to _ json(*args) -> String (18415.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 _ proc -> Proc (18415.0) -
self に対応する Proc オブジェクトを返します。
self に対応する Proc オブジェクトを返します。
生成される Proc オブジェクトを呼びだす(Proc#call)と、
Proc#callの第一引数をレシーバとして、 self という名前のメソッドを
残りの引数を渡して呼びだします。
//emlist[明示的に呼ぶ例][ruby]{
:to_i.to_proc["ff", 16] # => 255 ← "ff".to_i(16)と同じ
//}
//emlist[暗黙に呼ばれる例][ruby]{
# メソッドに & とともにシンボルを渡すと
# to_proc が呼ばれて Proc 化され、
# それがブロックとして渡される... -
Time
# to _ json(*args) -> String (18415.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\... -
Range
# to _ s -> String (18409.0) -
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文 字列に変換されます)。
self を文字列に変換します(始端と終端のオブジェクトは #to_s メソッドで文
字列に変換されます)。
@see Range#inspect
//emlist[例][ruby]{
(1..5).to_s # => "1..5"
("1".."5").to_s # => "1..5"
//} -
BigDecimal
# to _ json(*args) -> String (18397.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/bigdecimal'
BigDecimal('0.123456789123456789').to_json # => "{\"json_class\":\"BigDecimal\",\"b\":\"36:0.123456789123456789e0\"}"
//... -
Complex
# to _ json(*args) -> String (18397.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/complex'
Complex(2, 3).to_json # => "{\"json_class\":\"Complex\",\"r\":2,\"i\":3}"
//}
@see JSON::Generator::GeneratorMethods::Hash... -
Hash
# to _ hash -> self (18397.0) -
self を返します。
self を返します。
//emlist[例][ruby]{
hash = {}
p hash.to_hash # => {}
p hash.to_hash == hash # => true
//}
@see Object#to_hash, Hash#to_h -
Integer
# to _ bn -> OpenSSL :: BN (18397.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
Integer を同じ数を表す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'pp'
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
def to_bn
OpenSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.n... -
Object
# to _ a -> Array (18397.0) -
オブジェクトを配列に変換した結果を返します。 デフォルトでは定義されていません。
オブジェクトを配列に変換した結果を返します。
デフォルトでは定義されていません。
説明のためここに記載してありますが、
このメソッドは実際には Object クラスには定義されていません。
必要に応じてサブクラスで定義すべきものです。
//emlist[][ruby]{
p( {'a'=>1}.to_a ) # [["a", 1]]
p ['array'].to_a # ["array"]
p nil.to_a # []
//}
@see Object#to_ary,Kernel.#Array -
OpenStruct
# to _ json(*args) -> String (18397.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
@see JSON::Generator::GeneratorMethods::Hash#to_json -
Rational
# to _ d(nFig) -> BigDecimal (18397.0) -
自身を BigDecimal に変換します。
自身を BigDecimal に変換します。
nFig 桁まで計算を行います。
@param nFig 計算を行う桁数
@return BigDecimal に変換したオブジェクト
@raise ArgumentError nFig に 0 以下を指定した場合に発生します。
//emlist[][ruby]{
require "bigdecimal"
require "bigdecimal/util"
p Rational(1, 3).to_d(3) # => 0.333e0
p Rational(1, 3).to_d(10) # => 0.3333333333e0
//} -
Rational
# to _ json(*args) -> String (18397.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 使用しません。
//emlist[例][ruby]{
require 'json/add/rational'
Rational(1, 3).to_json # => "{\"json_class\":\"Rational\",\"n\":1,\"d\":3}"
//}
@see JSON::Generator::GeneratorMethods::H... -
Symbol
# to _ json(*args) -> String (18397.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
@see JSON::Generator::GeneratorMethods::Hash#to_json -
Thread
:: Backtrace :: Location # to _ s -> String (18397.0) -
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し ます。
self が表すフレームを Kernel.#caller と同じ表現にした文字列を返し
ます。
//emlist[例][ruby]{
# foo.rb
class Foo
attr_accessor :locations
def initialize(skip)
@locations = caller_locations(skip)
end
end
Foo.new(0..2).locations.map do |call|
puts call.to_s
end
# => path/to/foo.rb:5:in `initialize'
# path/to/foo... -
Forwardable
# def _ delegator(accessor , method , ali = method) -> () (18394.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
exten... -
Forwardable
# def _ instance _ delegator(accessor , method , ali = method) -> () (18394.0) -
メソッドの委譲先を設定します。
メソッドの委譲先を設定します。
@param accessor 委譲先のオブジェクト
@param method 委譲先のメソッド
@param ali 委譲元のメソッド
委譲元のオブジェクトで ali が呼び出された場合に、
委譲先のオブジェクトの method へ処理が委譲されるようになります。
委譲元と委譲先のメソッド名が同じ場合は, ali を省略することが可能です。
def_delegator は def_instance_delegator の別名になります。
例:
require 'forwardable'
class MyQueue
exten... -
Matrix
# cofactor _ expansion(row: nil , column: nil) -> object | Integer | Rational | Float (18394.0) -
row 行、もしくは column 列に関するラプラス展開をする。
row 行、もしくは column 列に関するラプラス展開をする。
通常の行列に対してはこれは単に固有値を計算するだけです。かわりにMatrix#determinant を
利用すべきです。
変則的な形状の行列に対してはそれ以上の意味を持ちます。例えば
row行/column列が行列やベクトルである場合には
//emlist[例][ruby]{
require 'matrix'
# Matrix[[7,6], [3,9]].laplace_expansion(column: 1) # => 45
Matrix[[Vector[1, 0], Vector[0, 1]], [2, 3]].... -
Net
:: POPMail # top(lines , dest=& # 39;& # 39;) -> String (18394.0) -
メールヘッダと本文 lines 行を受信し、文字列として返します。
メールヘッダと本文 lines 行を受信し、文字列として返します。
destを渡すとそのオブジェクトにデータを書き込みますが、これは
obsolete なので使わないでください。
@param lines 本文を読みだす行数
@param dest データを書き込む先(obsoleteなので使わないでください)
@raise TimeoutError 通信がタイムアウトした場合に発生します
@raise Net::POPError サーバが認証失敗以外のエラーを報告した場合に発生します
@raise Net::POPBadResponse サーバからの応答がプロトコル上不正であった場合に発... -
CSV
# to _ io -> self (18391.0) -
IO#to_io に委譲します。
IO#to_io に委譲します。
@see IO#to_io -
Pathname
# to _ path -> String (18391.0) -
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ クトにおいては、 to_s と同じです。
File.open などの引数に渡す際に呼ばれるメソッドです。 Pathname オブジェ
クトにおいては、 to_s と同じです。
@see Pathname#to_s -
ARGF
. class # to _ io -> IO (18379.0) -
ARGFが現在開いているファイルのFile、またはIOオブジェクトを 返します。
ARGFが現在開いているファイルのFile、またはIOオブジェクトを
返します。
ARGF.to_io # => #<File:glark.txt>
ARGF.to_io # => #<IO:<STDIN>>
@see ARGF.class#file, ARGF.class#to_write_io -
Array
# to _ csv(**options) -> String (18379.0) -
CSV.generate_line(self, options) と同様です。
CSV.generate_line(self, options) と同様です。
Array オブジェクトを 1 行の CSV 文字列に変換するためのショートカットです。
@param options CSV.generate_line と同様のオプションを指定します。
//emlist[][ruby]{
require 'csv'
p [1, 'Matz', :Ruby, Date.new(1965, 4, 14)].to_csv # => "1,Matz,Ruby,1965-04-14\n"
p [1, 'Matz',... -
Complex
# to _ f -> Float (18379.0) -
自身を Float に変換します。
自身を Float に変換します。
@raise RangeError 虚部が実数か、0 ではない場合に発生します。
//emlist[例][ruby]{
Complex(3).to_f # => 3.0
Complex(3.5).to_f # => 3.5
Complex(3, 2).to_f # => RangeError
//} -
Complex
# to _ i -> Integer (18379.0) -
自身を整数に変換します。
自身を整数に変換します。
@raise RangeError 虚部が実数か、0 ではない場合に発生します。
//emlist[例][ruby]{
Complex(3).to_i # => 3
Complex(3.5).to_i # => 3
Complex(3, 2).to_i # => RangeError
//} -
IPAddr
# to _ s -> String (18379.0) -
文字列に変換します。
文字列に変換します。
require 'ipaddr'
addr6 = IPAddr.new('::1')
addr6.to_s #=> "::1"
addr6.to_string #=> "0000:0000:0000:0000:0000:0000:0000:0001"
@see IPAddr#to_string -
IPAddr
# to _ string -> String (18379.0) -
標準的な文字列表現に変換します。
標準的な文字列表現に変換します。
require 'ipaddr'
addr6 = IPAddr.new('::1')
addr6.to_s #=> "::1"
addr6.to_string #=> "0000:0000:0000:0000:0000:0000:0000:0001"
@see IPAddr#to_s -
Object
# to _ s -> String (18379.0) -
オブジェクトの文字列表現を返します。
オブジェクトの文字列表現を返します。
Kernel.#print や Kernel.#sprintf は文字列以外の
オブジェクトが引数に渡された場合このメソッドを使って文字列に変換し
ます。
//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 #=> Cla... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (18379.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソッドでこの文字列にアクセス出来ます。
注意: 変換後のバイナリデータはポータブルではありません。 to_binary で得たバイナリデータは他のマシンに移動できません。他... -
WIN32OLE
# ole _ respond _ to?(name) -> bool (18379.0) -
指定したメソッドをオブジェクトがサポートしているか調べます。
指定したメソッドをオブジェクトがサポートしているか調べます。
OLEオートメーションサーバが引数で指定した名前のメソッド(プロパティ)を
サポートしているかどうかを調べます。
なお、OLEオートメーションの仕様により、メソッド名の大文字、小文字は区別
されません。
@param name 調べるメソッド名を文字列またはシンボルで指定します。
@return nameで指定したメソッドをオブジェクトが提供していれば真を返します。
excel = WIN32OLE.new('Excel.Application')
excel.ole_respond_to?(:quit) #=... -
Matrix
# cofactor(row , column) -> Integer | Rational | Float (18376.0) -
(row, column)-余因子を返します。
(row, column)-余因子を返します。
各要素の型によって返り値が変わります。
@param row 行
@param column 列
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が正方でない場合に発生します。
@see Matrix#adjugate