ライブラリ
- ビルトイン (278)
- bigdecimal (6)
-
cgi
/ core (3) -
cgi
/ html (4) -
cgi
/ session (6) -
cgi
/ session / pstore (1) - csv (1)
- date (4)
- dbm (2)
- delegate (4)
-
drb
/ extserv (1) - erb (2)
- fiddle (4)
-
fiddle
/ import (4) - gdbm (1)
- getoptlong (5)
- ipaddr (1)
-
irb
/ cmd / help (1) -
irb
/ context (2) -
irb
/ extend-command (1) -
irb
/ inspector (1) - json (5)
-
json
/ add / ostruct (1) -
json
/ add / struct (1) - kconv (5)
- matrix (37)
- mkmf (3)
- monitor (2)
-
net
/ http (2) -
net
/ imap (2) -
net
/ smtp (2) - openssl (31)
- optparse (4)
- ostruct (5)
- pathname (19)
- prime (20)
- pstore (5)
- psych (5)
- rake (6)
-
rdoc
/ markup (3) -
rdoc
/ markup / formatter (1) -
rdoc
/ parser / ruby (1) -
rdoc
/ top _ level (6) - resolv (1)
-
rexml
/ document (14) -
rexml
/ parsers / pullparser (1) -
ripper
/ filter (1) - rss (11)
-
rubygems
/ commands / update _ command (1) -
rubygems
/ dependency _ list (1) -
rubygems
/ installer (1) -
rubygems
/ requirement (1) -
rubygems
/ source _ index (1) -
rubygems
/ specification (3) -
rubygems
/ validator (1) - sdbm (2)
- set (2)
- singleton (1)
- socket (4)
- stringio (9)
- tsort (3)
- un (1)
- uri (13)
-
webrick
/ httpauth / authenticator (3) -
webrick
/ httprequest (1) -
webrick
/ httpresponse (1) -
webrick
/ httputils (3) -
webrick
/ log (1) -
webrick
/ server (1) -
win32
/ registry (4) - win32ole (1)
-
yaml
/ dbm (1) - zlib (5)
クラス
-
ARGF
. class (13) - Array (34)
- BasicObject (1)
- BigDecimal (6)
- Bignum (4)
-
CGI
:: Session :: FileStore (1) -
CGI
:: Session :: MemoryStore (1) -
CGI
:: Session :: NullStore (4) -
CGI
:: Session :: PStore (1) -
CSV
:: Table (1) - Complex (1)
- DBM (2)
-
DRb
:: ExtServ (1) - Date (4)
- Delegator (4)
- Dir (1)
- ERB (2)
-
Encoding
:: Converter (3) - Enumerator (15)
-
Enumerator
:: Lazy (30) -
Enumerator
:: Yielder (2) -
Fiddle
:: CStruct (2) -
Fiddle
:: Closure (1) -
Fiddle
:: Function (2) -
Fiddle
:: Pointer (1) - Fixnum (3)
- Float (2)
- GDBM (1)
-
Gem
:: Commands :: UpdateCommand (1) -
Gem
:: DependencyList (1) -
Gem
:: Installer (1) -
Gem
:: Requirement (1) -
Gem
:: SourceIndex (1) -
Gem
:: Specification (3) -
Gem
:: Validator (1) - GetoptLong (5)
- Hash (18)
- IO (17)
- IPAddr (1)
-
IRB
:: Context (2) -
IRB
:: ExtendCommand :: Help (1) -
IRB
:: Inspector (1) - Integer (5)
-
JSON
:: State (3) - MatchData (2)
- Matrix (17)
-
Matrix
:: EigenvalueDecomposition (7) -
Matrix
:: LUPDecomposition (3) - Module (12)
-
MonitorMixin
:: ConditionVariable (2) -
Net
:: HTTPGenericRequest (2) -
Net
:: IMAP (2) -
Net
:: SMTP (2) - Numeric (11)
- Object (10)
-
OpenSSL
:: BN (1) -
OpenSSL
:: OCSP :: Request (2) -
OpenSSL
:: PKey :: EC :: Group (6) -
OpenSSL
:: X509 :: Attribute (1) -
OpenSSL
:: X509 :: ExtensionFactory (8) -
OpenSSL
:: X509 :: Request (4) -
OpenSSL
:: X509 :: Store (3) -
OpenSSL
:: X509 :: StoreContext (5) - OpenStruct (6)
- OptionParser (3)
- PStore (4)
-
PStore
:: DummyMutex (1) - Pathname (19)
- Prime (4)
-
Prime
:: EratosthenesGenerator (1) -
Prime
:: Generator23 (1) -
Prime
:: PseudoPrimeGenerator (13) -
Prime
:: TrialDivisionGenerator (1) - Proc (1)
-
Process
:: Status (7) -
Psych
:: Nodes :: Node (3) -
Psych
:: Visitors :: YAMLTree (2) -
RDoc
:: Markup (3) -
RDoc
:: Markup :: Formatter (1) -
RDoc
:: Parser :: Ruby (1) -
RDoc
:: TopLevel (6) -
REXML
:: Attribute (2) -
REXML
:: Attributes (1) -
REXML
:: CData (1) -
REXML
:: Child (1) -
REXML
:: Element (2) -
REXML
:: Entity (1) -
REXML
:: Parent (4) -
REXML
:: Parsers :: PullParser (1) -
REXML
:: Text (2) -
RSS
:: Rss :: Channel :: Cloud (2) -
RSS
:: TaxonomyTopicModel :: TaxonomyTopic (2) -
RSS
:: TaxonomyTopicsModel :: TaxonomyTopics (1) -
Rake
:: DefaultLoader (1) -
Rake
:: TaskArguments (4) - Range (3)
- Rational (3)
-
Resolv
:: DNS :: Resource :: IN :: WKS (1) -
Ripper
:: Filter (1) -
RubyVM
:: InstructionSequence (2) - SDBM (2)
- StopIteration (1)
- String (14)
- StringIO (9)
- Struct (9)
- Symbol (5)
- Thread (2)
-
Thread
:: Backtrace :: Location (1) -
Thread
:: Queue (1) - ThreadGroup (1)
- Time (3)
- TrueClass (1)
- UDPSocket (3)
- UNIXSocket (1)
-
URI
:: Generic (7) -
URI
:: MailTo (6) - UnboundMethod (3)
- UncaughtThrowError (1)
- Vector (10)
-
WEBrick
:: BasicLog (1) -
WEBrick
:: GenericServer (1) -
WEBrick
:: HTTPRequest (1) -
WEBrick
:: HTTPResponse (1) -
WEBrick
:: HTTPUtils :: FormData (3) - WIN32OLE (1)
-
Win32
:: Registry (4) -
YAML
:: DBM (1) -
Zlib
:: GzipReader (3) -
Zlib
:: GzipWriter (1) -
Zlib
:: ZStream (1)
モジュール
-
CGI
:: HtmlExtension (4) -
CGI
:: QueryExtension (1) -
CGI
:: QueryExtension :: Value (2) - DublinCoreModel (6)
- Enumerable (44)
-
Fiddle
:: Importer (2) -
IRB
:: ExtendCommandBundle (1) -
JSON
:: Generator :: GeneratorMethods :: String (1) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1) - Kernel (4)
-
OpenSSL
:: Buffering (1) -
OptionParser
:: Arguable (1) -
Rake
:: TaskManager (1) - Singleton (1)
- TSort (3)
-
WEBrick
:: HTTPAuth :: Authenticator (3)
キーワード
- % (1)
- & (1)
- << (1)
- == (1)
- >> (1)
- [] (1)
- []= (2)
- about (1)
- about= (1)
- absolute? (1)
-
absolute
_ path (1) -
add
_ class _ or _ module (1) -
add
_ html (1) -
add
_ namespace (2) -
add
_ special (1) -
add
_ tag (1) -
add
_ trace _ func (1) -
add
_ word _ pair (1) - ancestors (1)
- ascend (1)
-
auto
_ indent _ mode (1) -
auto
_ indent _ mode= (1) - autoclose= (1)
- autoclose? (1)
- autoload (1)
- autoload? (1)
- autorequire (1)
- autorequire= (1)
- basename (1)
- bind (1)
-
body
_ stream (1) -
body
_ stream= (1) - bsearch (2)
-
bsearch
_ index (1) -
buffer
_ initial _ length= (1) - bytes (3)
- call (1)
- captures (1)
- casecmp (1)
- chars (3)
-
check
_ signedness (2) - children (1)
- chown (1)
- chunk (3)
-
chunk
_ while (1) - chunked= (1)
- cleanup (1)
- clone (1)
- close (2)
- codepoints (3)
- coerce (1)
- cofactor (2)
-
cofactor
_ expansion (1) - collect (5)
- collect! (1)
- collect2 (1)
-
collect
_ concat (2) - column (1)
-
column
_ vectors (1) - combination (1)
-
create
_ ext (1) -
create
_ extension (1) -
create
_ makefile (1) -
create
_ rule (1) -
cross
_ product (1) -
current
_ cert (1) -
current
_ crl (1) - cycle (2)
-
dc
_ contributor (1) -
dc
_ contributor= (1) -
dc
_ contributors (1) -
dc
_ creator (1) -
dc
_ creator= (1) -
dc
_ creators (1) - debug (1)
-
default
_ proc= (1) - delete (1)
-
delete
_ if (5) - denominator (1)
- descend (1)
- detect (1)
- downto (2)
- drop (1)
-
drop
_ while (3) - dup (2)
- each (25)
- each2 (1)
-
each
_ byte (5) -
each
_ char (4) -
each
_ child (3) -
each
_ codepoint (4) -
each
_ cons (1) -
each
_ entry (1) -
each
_ index (2) -
each
_ key (1) -
each
_ line (9) -
each
_ pair (4) -
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) - eigen (1)
- eigensystem (1)
-
eigenvector
_ matrix (1) -
eigenvector
_ matrix _ inv (1) - eigenvectors (1)
-
enable
_ starttls _ auto (1) - enclose (1)
- entries (1)
-
enum
_ for (4) - eql? (1)
- executable? (1)
-
executable
_ real? (1) - execute (1)
- feed (1)
- fetch (1)
-
file
_ absolute _ name (1) -
file
_ absolute _ name= (1) - find (3)
-
find
_ all (2) -
find
_ index (4) -
find
_ local _ symbol (1) -
find
_ module _ named (1) -
flat
_ map (2) - force (1)
-
full
_ name (1) - generator (1)
- getopts (1)
- grep (1)
-
grep
_ v (1) -
group
_ by (1) - gsub (1)
- gsub! (1)
- headers (1)
- headers= (1)
- hostname= (1)
- index (3)
-
inner
_ product (1) -
insert
_ output (1) - inspect (7)
-
inspect
_ value (1) -
install
_ alias _ method (1) -
instance
_ methods (1) -
issuer
_ certificate (1) -
issuer
_ certificate= (1) - kconv (1)
-
keep
_ if (2) -
laplace
_ expansion (1) - lazy (2)
- lchown (1)
- lines (7)
- list (1)
- load (1)
- logger (1)
- lup (1)
-
lup
_ decomposition (1) - magnitude (1)
- map (5)
- map! (1)
-
marshal
_ dump (1) -
max
_ by (4) -
max
_ value _ length (1) -
max
_ value _ name _ length (1) - merge! (1)
-
min
_ by (2) -
minmax
_ by (1) - modulo (1)
- name (1)
- next (2)
-
next
_ values (1) - norm (1)
- normalize (1)
- normalize! (1)
-
num
_ bytes (1) -
num
_ keys (1) -
num
_ values (1) - numerator (5)
-
ok
_ to _ remove? (1) -
ole
_ query _ interface (1) -
on
_ default (1) - owner (1)
- pack (1)
- partition (1)
- peek (1)
-
peek
_ values (1) - permutation (2)
- prepended (1)
-
previous
_ sibling= (1) - prime? (1)
-
prime
_ division (1) - print (1)
-
private
_ instance _ methods (1) -
protected
_ instance _ methods (1) -
protected
_ methods (1) - protocol (2)
- protocol= (1)
-
public
_ instance _ methods (1) -
public
_ method (1) -
public
_ methods (1) - purpose= (2)
- push (1)
- putback (2)
- putc (1)
- quiet (1)
- quiet= (1)
- quiet? (1)
-
quirks
_ mode= (1) - r (1)
- realm (1)
- reject (8)
- reject! (3)
-
repeated
_ combination (1) -
repeated
_ permutation (2) - resources (1)
-
respond
_ to? (1) -
respond
_ to _ missing? (2) - restore (1)
- result (2)
-
reverse
_ each (2) - rewind (2)
- rindex (1)
- round (4)
-
route
_ to (1) - run (1)
- scan (1)
- select (5)
- select! (2)
- send (3)
-
send
_ io (1) -
server
_ protocol (1) -
set
_ default _ paths (1) -
set
_ generator (1) -
set
_ trace _ func (1) - setuid? (1)
-
singleton
_ class? (1) -
singleton
_ method _ undefined (1) -
singleton
_ methods (1) - size (1)
- slice (1)
-
slice
_ after (4) -
slice
_ before (5) -
slice
_ when (2) - solve (1)
-
sort
_ by (1) -
sort
_ by! (1) -
source
_ location (1) - start (1)
-
starttls
_ auto? (1) - step (8)
-
stop
_ service (1) - stopped? (1)
- stopsig (1)
- store (3)
- struct (1)
-
subject
_ certificate (1) -
subject
_ certificate= (1) -
subject
_ request (1) -
subject
_ request= (1) - subsec (1)
- succ (6)
- summarize (2)
- synchronize (1)
- take (1)
-
take
_ while (4) - terminated? (1)
- times (1)
- to= (1)
-
to
_ a (8) -
to
_ ary (4) -
to
_ binary (1) -
to
_ c (1) -
to
_ der (4) -
to
_ enum (4) -
to
_ f (2) -
to
_ h (3) -
to
_ hash (1) -
to
_ i (4) -
to
_ int (1) -
to
_ json (4) -
to
_ mailtext (1) -
to
_ pem (2) -
to
_ ptr (1) -
to
_ rfc822text (1) -
to
_ ruby (2) -
to
_ s (16) -
to
_ set (2) -
to
_ string (1) -
to
_ text (2) -
to
_ value (1) - toeuc (1)
- tokens (1)
-
total
_ out (1) - touch (1)
- toutf16 (1)
- toutf32 (1)
- toutf8 (1)
- transform (1)
- truncate (5)
- trust= (2)
-
tsort
_ each (1) -
tv
_ usec (1) -
uid
_ sort (1) -
uid
_ store (1) -
ultra
_ safe (1) -
ultra
_ safe= (1) - uniq (2)
- uniq! (2)
-
unit
_ test (1) - unlink (1)
- unpack (2)
- unshift (1)
- upcase (1)
- update (7)
-
upper
_ bound (1) -
upper
_ bound= (1) - upto (5)
- usec (1)
- userdb (1)
- userinfo= (1)
- utime (1)
- v (1)
-
v
_ inv (1) - value (2)
- value= (1)
- values (2)
-
values
_ at (2) - verify (1)
- wait (1)
-
wait
_ until (1) -
which
_ to _ update (1) -
with
_ defaults (1) -
with
_ index (4) -
with
_ object (4) - write (1)
- yield (1)
- zip (4)
検索結果
先頭5件
-
URI
:: MailTo # to -> String (72325.0) -
自身の e-mail アドレスを文字列で返します。
自身の e-mail アドレスを文字列で返します。
例:
require 'uri'
p URI.parse("mailto:nospam@example.com").to #=> "nospam@example.com" -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (46330.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (46330.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Gem
:: Commands :: UpdateCommand # which _ to _ update(highest _ installed _ gems , gem _ names) -> Array (45607.0) -
更新が必要な Gem のリストを返します。
更新が必要な Gem のリストを返します。 -
Numeric
# numerator -> Integer (45604.0) -
自身を Rational に変換した時の分子を返します。
自身を Rational に変換した時の分子を返します。
@return 分子を返します。
@see Numeric#denominator、Integer#numerator、Float#numerator、Rational#numerator、Complex#numerator -
JSON
:: Generator :: GeneratorMethods :: TrueClass # to _ json(state _ or _ hash = nil) -> String (45325.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
"true" という文字列を返します。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]{
require "json"
true.to_json # => "true"
//} -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (37030.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (37030.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
CGI
:: HtmlExtension # image _ button(attributes) -> String (36904.0) -
タイプが image の input 要素を生成します。
タイプが image の input 要素を生成します。
@param attributes 属性をハッシュで指定します。
例:
image_button({ "SRC" => "url", "ALT" => "string" })
# <INPUT TYPE="image" SRC="url" ALT="string"> -
CGI
:: HtmlExtension # radio _ button(attributes) -> String (36904.0) -
タイプが radio である input 要素を生成します。
タイプが radio である input 要素を生成します。
@param attributes 属性をハッシュで指定します。
例:
radio_button({ "NAME" => "name", "VALUE" => "value", "ID" => "foo" })
# <INPUT TYPE="radio" NAME="name" VALUE="value" ID="foo"> -
Date
# upto(max) -> Enumerator (36904.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto -
Integer
# upto(max) -> Enumerator (36904.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 -
Matrix
# column _ vectors -> [Vector] (36904.0) -
自分自身を列ベクトルの配列として返します。
自分自身を列ベクトルの配列として返します。
//emlist[例][ruby]{
require 'matrix'
a1 = [ 1, 2, 3]
a2 = [10, 15, 20]
a3 = [-1, -2, 1.5]
m = Matrix[a1, a2, a3]
p m.column_vectors # => [Vector[1, 10, -1], Vector[2, 15, -2], Vector[3, 20, 1.5]]
//} -
Encoding
:: Converter # insert _ output(string) -> nil (36676.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換器内のバッファに文字列を挿入します。
バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換先がステートフルなエンコーディングであった場合、
挿入された文字列は状態に基づいて変換され、状態を更新します。
このメソッドは変換に際してエラーが発生した際にのみ利用されるべきです。
@param string 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.... -
Fiddle
:: Pointer # to _ value -> object (36625.0) -
自身はヒープに確保された Ruby のオブジェクトを指すポインタであると仮定して、 自身が指すオブジェクトを返します。
自身はヒープに確保された Ruby のオブジェクトを指すポインタであると仮定して、
自身が指すオブジェクトを返します。
例:
require 'fiddle'
s = 'abc'
i = Fiddle.dlwrap(s)
cptr = Fiddle::Pointer.new(i)
p cptr.to_value #=> "abc" -
URI
:: Generic # route _ to(dst) -> URI :: Generic (36625.0) -
自身から dst への相対パスを返します。
自身から dst への相対パスを返します。
@param dst URI を文字列かURIオブジェクトで与えます。
例:
require 'uri'
p URI.parse('http://example.com/').route_to('http://example.com/foo/bar.html')
#=> #<URI::Generic:0x20100198 URL:foo/bar.html> -
Gem
:: Specification # to _ ruby -> String (36607.0) -
自身を再現するための Ruby スクリプトを文字列で返します。
自身を再現するための Ruby スクリプトを文字列で返します。
省略されている値はデフォルト値が使用されます。 -
Psych
:: Nodes :: Node # to _ ruby -> object (36607.0) -
AST を ruby のオブジェクトに変換します。
AST を ruby のオブジェクトに変換します。 -
BasicObject
# singleton _ method _ undefined(name) -> object (36604.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... -
CGI
:: HtmlExtension # image _ button(src = "" , name = nil , alt = nil) -> String (36604.0) -
タイプが image の input 要素を生成します。
タイプが image の input 要素を生成します。
@param src src 属性の値を指定します。
@param name name 属性の値を指定します。
@param alt alt 属性の値を指定します。
例:
image_button("url")
# <INPUT TYPE="image" SRC="url">
image_button("url", "name", "string")
# <INPUT TYPE="image" SRC="url" NAME="name" ALT="string"> -
CGI
:: HtmlExtension # radio _ button(name = "" , value = nil , checked = nil) -> String (36604.0) -
タイプが radio である input 要素を生成します。
タイプが radio である input 要素を生成します。
@param name name 属性の値を指定します。
@param value value 属性の値を指定します。
@param checked 真ならば checked 属性を設定します。
例:
radio_button("name", "value")
# <INPUT TYPE="radio" NAME="name" VALUE="value">
radio_button("name", "value", true)
# <INPUT TYPE="radio" NAME="name" ... -
Complex
# numerator -> Complex (36604.0) -
分子を返します。
分子を返します。
//emlist[例][ruby]{
Complex('1/2+2/3i').numerator # => (3+4i)
Complex(3).numerator # => (3+0i)
//}
@see Complex#denominator -
Date
# upto(max) {|date| . . . } -> self (36604.0) -
このメソッドは、step(max, 1){|date| ...} と等価です。
このメソッドは、step(max, 1){|date| ...} と等価です。
@param max 日付オブジェクト
@see Date#step, Date#downto -
DublinCoreModel
# dc _ contributor (36604.0) -
@todo
@todo -
DublinCoreModel
# dc _ contributor= (36604.0) -
@todo
@todo -
DublinCoreModel
# dc _ contributors (36604.0) -
@todo
@todo -
Float
# numerator -> Integer (36604.0) -
自身を Rational に変換した時の分子を返します。
自身を Rational に変換した時の分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
2.0.numerator # => 2
0.5.numerator # => 1
//}
@see Float#denominator -
Gem
:: Specification # autorequire -> String (36604.0) -
非推奨の属性です。
非推奨の属性です。 -
Gem
:: Specification # autorequire=(lib) (36604.0) -
非推奨の属性です。
非推奨の属性です。 -
IO
# autoclose=(bool) (36604.0) -
auto-close フラグを設定します。
auto-close フラグを設定します。
フラグが設定されているオブジェクトは
close時/GCでのファイナライザ呼出時にファイルデスクリプタを close します。
偽を設定すると close しません。
@param bool 真偽値でフラグを設定します
@see IO#autoclose?
f = open("/dev/null")
IO.for_fd(f.fileno)
# ...
f.gets # may cause Errno::EBADF
f = open("/dev/null")
IO.for_fd(f.fileno).auto... -
IO
# autoclose? -> bool (36604.0) -
auto-close フラグを返します。
auto-close フラグを返します。
//emlist[例][ruby]{
IO.open(IO.sysopen("testfile")) do |io|
io.autoclose? # => true
io.autoclose = false
io.autoclose? # => false
end
//}
@see IO#autoclose= -
IRB
:: Context # auto _ indent _ mode -> bool (36604.0) -
入力が次の行に継続した時に自動で字下げを行うかどうかを返します。
入力が次の行に継続した時に自動で字下げを行うかどうかを返します。
デフォルト値は false です。
@return 自動で字下げを行う場合は true を返します。行わない場合は false
を返します。
@see IRB::Context#auto_indent_mode= -
IRB
:: Context # auto _ indent _ mode=(val) (36604.0) -
入力が次の行に継続した時に自動で字下げを行うかどうかを val に設定します。
入力が次の行に継続した時に自動で字下げを行うかどうかを val に設定します。
@param val true を指定した場合、自動で字下げを行います。false を指定し
た場合は自動で字下げを行いません。
IRB::Context#prompt_mode の変更に影響を受ける事に注意してください。
@see IRB::Context#auto_indent_mode -
Integer
# numerator -> Integer (36604.0) -
分子(常に自身)を返します。
分子(常に自身)を返します。
@return 分子を返します。
//emlist[][ruby]{
10.numerator # => 10
-10.numerator # => -10
//}
@see Integer#denominator -
Integer
# upto(max) {|n| . . . } -> Integer (36604.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 -
Kernel
# touch -> () (36604.0) -
ファイルのアクセス時刻と修正時刻を現在の時刻に変更します。
ファイルのアクセス時刻と修正時刻を現在の時刻に変更します。
ruby -run -e touch -- [OPTION] FILE
-v 詳細表示
@see touch(1) -
Module
# autoload(const _ name , feature) -> nil (36604.0) -
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
定数 const_name を最初に参照した時に feature を Kernel.#require するように設定します。
const_name が autoload 設定されていて、まだ定義されてない(ロードされていない)ときは、
autoload する対象を置き換えます。
const_name が(autoloadではなく)既に定義されているときは何もしません。
@param const_name String または Symbol で指定します。
なお、const_name には、"::" 演算子を含めることはできません。
つまり、self の直下に定... -
Module
# autoload?(const _ name) -> String | nil (36604.0) -
autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。 また、ロード済みなら nil を返します。
autoload 定数がまだ定義されてない(ロードされていない) ときにそのパス名を返します。
また、ロード済みなら nil を返します。
@param const_name String または Symbol で指定します。
@see Kernel.#autoload?
//emlist[例][ruby]{
autoload :Date, 'date'
autoload?(:Date) # => "date"
Date
autoload?(:Date) # => nil
autoload?(:Foo) # => nil
//} -
Net
:: IMAP # uid _ store(set , attr , flags) -> [Net :: IMAP :: FetchData] | nil (36604.0) -
UID STORE コマンドを送り、メールボックス内のメッセージを 更新します。
UID STORE コマンドを送り、メールボックス内のメッセージを
更新します。
set で更新するメッセージを指定します。
これには UID、UID の配列、もしくは
Range オブジェクトを渡します。
Net::IMAP#select で指定したメールボックスを対象とします。
attr で何をどのように変化させるかを指定します。
以下を指定することができます。
* "FLAGS"
* "+FLAGS"
* "-FLAGS"
それぞれメッセージのフラグの置き換え、追加、削除を意味します。
詳しくは 2060 の 6.4.6 を参考にしてください。
返り値は更新された内... -
Net
:: SMTP # enable _ starttls _ auto(context = Net :: SMTP . default _ ssl _ context) -> () (36604.0) -
その Net::SMTP オブジェクトがSTARTTLSが利用可能な場合 (つまりサーバがSTARTTLSを広告した場合)のみにSTARTTLSを利用する ように設定します。
その Net::SMTP オブジェクトがSTARTTLSが利用可能な場合
(つまりサーバがSTARTTLSを広告した場合)のみにSTARTTLSを利用する
ように設定します。
@see Net::SMTP#starttls?, Net::SMTP#starttls_auto?, Net::SMTP#enable_starttls_auto
@param context SSL接続で利用する OpenSSL::SSL::SSLContext
@see Net::SMTP#starttls?, Net::SMTP#starttls_auto?, Net::SMTP#enable_starttl... -
Net
:: SMTP # starttls _ auto? -> bool (36604.0) -
その Net::SMTP オブジェクトが利用可能な場合にのみにSTARTTLSを利用するならば 真を返します。
その Net::SMTP オブジェクトが利用可能な場合にのみにSTARTTLSを利用するならば
真を返します。
@see Net::SMTP#starttls?, Net::SMTP#starttls_always?, Net::SMTP#enable_starttls_auto -
Rational
# numerator -> Integer (36604.0) -
分子を返します。
分子を返します。
@return 分子を返します。
//emlist[例][ruby]{
Rational(7).numerator # => 7
Rational(7, 1).numerator # => 7
Rational(9, -4).numerator # => -9
Rational(-2, -10).numerator # => 1
//}
@see Rational#denominator -
String
# toeuc -> String (36604.0) -
self のエンコーディングを EUC-JP に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを EUC-JP に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-exm0', str)
を使ってください。
@see Kconv.#toeuc -
String
# toutf16 -> String (36604.0) -
self のエンコーディングを UTF-16BE に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを UTF-16BE に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-w16xm0', str)
を使ってください。
@see Kconv.#toutf16 -
String
# toutf32 -> String (36604.0) -
self のエンコーディングを UTF-32 に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを UTF-32 に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-w32xm0', str)
を使ってください。
@see Kconv.#toutf32 -
String
# toutf8 -> String (36604.0) -
self のエンコーディングを UTF-8 に変換した文字列を 返します。変換元のエンコーディングは文字列の内容から推測します。
self のエンコーディングを UTF-8 に変換した文字列を
返します。変換元のエンコーディングは文字列の内容から推測します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換したくない場合は、 NKF.#nkf('-wxm0', str)
を使ってください。
@see Kconv.#toutf8 -
String
# upto(max , exclusive = false) {|s| . . . } -> self (36604.0) -
self から始めて max まで 「次の文字列」を順番にブロックに与えて繰り返します。 「次」の定義については String#succ を参照してください。
self から始めて max まで
「次の文字列」を順番にブロックに与えて繰り返します。
「次」の定義については String#succ を参照してください。
たとえば以下のコードは a, b, c, ... z, aa, ... az, ..., za を
出力します。
//emlist[][ruby]{
("a" .. "za").each do |str|
puts str
end
'a'.upto('za') do |str|
puts str
end
//}
@param max 繰り返しをやめる文字列
@param exclusive max を含むかどうか... -
Zlib
:: ZStream # total _ out -> Integer (36604.0) -
ストリームの出力したデータの総バイト数を返します。
ストリームの出力したデータの総バイト数を返します。 -
JSON
:: Generator :: GeneratorMethods :: String # to _ json(state _ or _ hash = nil) -> String (36433.0) -
自身から生成した JSON 形式の文字列を返します。
自身から生成した JSON 形式の文字列を返します。
自身のエンコードは UTF-8 であるべきです。
"\u????" のように UTF-16 ビッグエンディアンでエンコードされた文字列を返すことがあります。
@param state_or_hash 生成する JSON 形式の文字列をカスタマイズするため
に JSON::State のインスタンスか、
JSON::State.new の引数と同じ Hash を
指定します。
//emlist[例][ruby]... -
URI
:: MailTo # to _ mailtext -> String (36346.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 (36346.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=(s) (36325.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... -
CGI
:: QueryExtension :: Value # to _ a -> Array (36310.0) -
@todo
@todo -
CGI
:: QueryExtension :: Value # to _ ary -> Array (36310.0) -
@todo
@todo -
CGI
:: Session :: NullStore # restore -> Hash (36304.0) -
セッションの状態を復元したハッシュを返します。 このクラスでは何もしません。
セッションの状態を復元したハッシュを返します。
このクラスでは何もしません。 -
RSS
:: TaxonomyTopicModel :: TaxonomyTopic # about (36304.0) -
@todo
@todo -
RSS
:: TaxonomyTopicModel :: TaxonomyTopic # about= (36304.0) -
@todo
@todo -
RSS
:: TaxonomyTopicsModel :: TaxonomyTopics # resources (36304.0) -
@todo
@todo -
WEBrick
:: HTTPAuth :: Authenticator # userdb -> WEBrick :: HTTPAuth :: Htpasswd | WEBrick :: HTTPAuth :: Htdigest (36304.0) -
認証のためのユーザデータベースを返します。
認証のためのユーザデータベースを返します。
@see WEBrick::HTTPAuth::BasicAuth, WEBrick::HTTPAuth::Htdigest -
Object
# to _ enum(method = :each , *args) -> Enumerator (28246.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 (28246.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"]
#... -
OpenSSL
:: PKey :: EC :: Group # set _ generator(generator , order , cofactor) -> self (27904.0) -
群のパラメータを設定します。
群のパラメータを設定します。
@param generator 生成元(OpenSSL::PKey::EC::Point オブジェクト)
@param order 生成元の位数(OpenSSL::BN オブジェクト)
@param cofactor 余因子OpenSSL::BN オブジェクト
@raise OpenSSL::PKey::EC::Group::Error 設定に失敗した場合に発生します -
REXML
:: Attributes # to _ a -> [Attribute] (27625.0) -
属性の配列を返します。
属性の配列を返します。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a x='1' y='2' z='3' />")
doc.root.attributes.to_a # => [x='1', y='2', z='3']
//} -
Delegator
# respond _ to _ missing?(m , include _ private) -> bool (27607.0) -
@param m メソッド名を指定します。
@param m メソッド名を指定します。
@param include_private 真を指定すると private メソッドも調べます。 -
Enumerator
:: Lazy # chunk {|elt| . . . } -> Enumerator :: Lazy (27604.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5... -
Enumerator
:: Lazy # chunk(initial _ state) {|elt , state| . . . } -> Enumerator :: Lazy (27604.0) -
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
Enumerable#chunk と同じですが、配列ではなく Enumerator::Lazy を返します。
//emlist[例][ruby]{
1.step.lazy.chunk{ |n| n % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007f8bf18118f0>:each>>
1.step.lazy.chunk{ |n| n % 3 == 0 }.take(5).force
# => [[false, [1, 2]], [true, [3]], [false, [4, 5... -
Matrix
:: EigenvalueDecomposition # eigenvectors -> [Vector] (27604.0) -
右固有ベクトルを配列で返します。
右固有ベクトルを配列で返します。 -
Module
# ancestors -> [Class , Module] (27604.0) -
クラス、モジュールのスーパークラスとインクルードしているモジュール を優先順位順に配列に格納して返します。
クラス、モジュールのスーパークラスとインクルードしているモジュール
を優先順位順に配列に格納して返します。
//emlist[例][ruby]{
module Foo
end
class Bar
include Foo
end
class Baz < Bar
p ancestors
p included_modules
p superclass
end
# => [Baz, Bar, Foo, Object, Kernel, BasicObject]
# => [Foo, Kernel]
# => Bar
//}
@see Module#included_modules
... -
OpenSSL
:: X509 :: Store # purpose=(purpose) (27604.0) -
証明書の使用目的を設定します。
証明書の使用目的を設定します。
以下の定数値のうちいずれか1つを渡します。
* OpenSSL::X509::PURPOSE_ANY
* OpenSSL::X509::PURPOSE_CRL_SIGN
* OpenSSL::X509::PURPOSE_NS_SSL_SERVER
* OpenSSL::X509::PURPOSE_SMIME_ENCRYPT
* OpenSSL::X509::PURPOSE_SMIME_SIGN
* OpenSSL::X509::PURPOSE_SSL_CLIENT
* OpenSSL::X509::PURPOSE_SSL_SERVE... -
OpenSSL
:: X509 :: Store # trust=(trust) (27604.0) -
@todo
@todo
以下のいずれかの定数の値を指定します。
* OpenSSL::X509::TRUST_COMPAT
* OpenSSL::X509::TRUST_EMAIL
* OpenSSL::X509::TRUST_OBJECT_SIGN
* OpenSSL::X509::TRUST_SSL_CLIENT
* OpenSSL::X509::TRUST_SSL_SERVER
* OpenSSL::X509::TRUST_OCSP_REQUEST
* OpenSSL::X509::TRUST_OCSP_SIGN
@param trust 整数値
@see OpenSSL::X5... -
OpenSSL
:: X509 :: StoreContext # purpose=(purpose) (27604.0) -
証明書の使用目的を設定します。
証明書の使用目的を設定します。
以下の定数値のうちいずれか1つを渡します。
* OpenSSL::X509::PURPOSE_ANY
* OpenSSL::X509::PURPOSE_CRL_SIGN
* OpenSSL::X509::PURPOSE_NS_SSL_SERVER
* OpenSSL::X509::PURPOSE_SMIME_ENCRYPT
* OpenSSL::X509::PURPOSE_SMIME_SIGN
* OpenSSL::X509::PURPOSE_SSL_CLIENT
* OpenSSL::X509::PURPOSE_SSL_SERVE... -
OpenSSL
:: X509 :: StoreContext # trust=(trust) (27604.0) -
@todo
@todo
以下のいずれかの定数の値を指定します。
* OpenSSL::X509::TRUST_COMPAT
* OpenSSL::X509::TRUST_EMAIL
* OpenSSL::X509::TRUST_OBJECT_SIGN
* OpenSSL::X509::TRUST_SSL_CLIENT
* OpenSSL::X509::TRUST_SSL_SERVER
* OpenSSL::X509::TRUST_OCSP_REQUEST
* OpenSSL::X509::TRUST_OCSP_SIGN
@param trust 整数値
@see OpenSSL::X... -
Prime
:: PseudoPrimeGenerator # upper _ bound=(upper _ bound) (27604.0) -
新しい列挙上界をセットします。
新しい列挙上界をセットします。
@param upper_bound 新しい上界を整数または nil で指定します。 nil は上界がなく無限に素数を列挙すべきであることを意味します。 -
RDoc
:: TopLevel # add _ class _ or _ module(collection , class _ type , name , superclass) -> RDoc :: NormalClass | RDoc :: SingleClass | RDoc :: NormalModule (27604.0) -
collection に name で指定したクラス、モジュールを追加します。
collection に name で指定したクラス、モジュールを追加します。
@param collection クラス、モジュールを追加する先を Hash オブジェ
クトで指定します。
@param class_type 追加するクラス、モジュールを RDoc::NormalClass、
RDoc::SingleClass、RDoc::NormalModule オ
ブジェクトのいずれかで指定します。
@param name クラス名を文字列で指定します。
@param su... -
RDoc
:: TopLevel # find _ module _ named(name) -> RDoc :: NormalModule (27604.0) -
RDoc が収集したクラスの内、name で指定した名前のモジュールを返します。 見つからなかった場合は nil を返します。
RDoc が収集したクラスの内、name で指定した名前のモジュールを返します。
見つからなかった場合は nil を返します。
@param name モジュール名を文字列で指定します。 -
Process
:: Status # to _ s -> String (27403.0) -
to_i.to_s と同じです。
to_i.to_s と同じです。 -
Numeric
# to _ int -> Integer (27391.0) -
self.to_i と同じです。
self.to_i と同じです。
//emlist[例][ruby]{
(2+0i).to_int # => 2
Rational(3).to_int # => 3
//} -
Enumerable
# to _ set(klass = Set , *args) -> Set (27382.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
引数 klass を与えた場合、Set クラスの代わりに、指定した集合クラスの
インスタンスを作ります。
この引数を指定することで、SortedSet あるいはその他のユーザ定義の
集合クラスのインスタンスを作ることができます
(ここでいう集合クラスとは、Setとメソッド/クラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラ... -
Enumerable
# to _ set(klass = Set , *args) {|o| . . . } -> Set (27382.0) -
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
Enumerable オブジェクトの要素から、新しい集合オブジェクトを作ります。
引数 klass を与えた場合、Set クラスの代わりに、指定した集合クラスの
インスタンスを作ります。
この引数を指定することで、SortedSet あるいはその他のユーザ定義の
集合クラスのインスタンスを作ることができます
(ここでいう集合クラスとは、Setとメソッド/クラスメソッドで互換性のあるクラスです)。
引数 args およびブロックは、集合オブジェクトを生成するための new
メソッドに渡されます。
@param klass 生成する集合クラスを指定します。
@param args 集合クラ... -
Numeric
# to _ c -> Complex (27379.0) -
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
自身を複素数 (Complex) に変換します。Complex(self, 0) を返します。
//emlist[例][ruby]{
1.to_c # => (1+0i)
-1.to_c # => (-1+0i)
1.0.to_c # => (1.0+0i)
Rational(1, 2).to_c # => ((1/2)+0i)
//}
Numeric のサブクラスは、このメソッドを適切に再定義しなければなりません。 -
Struct
# to _ json(*args) -> String (27379.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 # =... -
OpenStruct
# to _ json(*args) -> String (27361.0) -
自身を JSON 形式の文字列に変換して返します。
自身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡されます。
@see JSON::Generator::GeneratorMethods::Hash#to_json -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (27343.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 で得たバイナリデータは他のマシンに移動できません。他... -
Enumerator
# next _ values -> Array (27340.0) -
「次」のオブジェクトを配列で返します。
「次」のオブジェクトを配列で返します。
Enumerator#next とほぼ同様の挙動をします。終端まで到達した場合は
StopIteration 例外を発生させます。
このメソッドは、
yield
と
yield nil
を区別するために使えます。
next メソッドによる外部列挙の状態は他のイテレータメソッドによる
内部列挙には影響を与えません。
ただし、 IO#each_line のようにおおもとの列挙メカニズムが副作用を
伴っている場合には影響があり得ます。
//emlist[例: next と next_values の違いを][ruby]{
o = Object... -
Enumerable
# to _ h(*args) -> Hash (27325.0) -
self を [key, value] のペアの配列として解析した結果を Hash にして 返します。
self を [key, value] のペアの配列として解析した結果を Hash にして
返します。
@param args each の呼び出し時に引数として渡されます。
//emlist[例][ruby]{
%i[hello world].each_with_index.to_h # => {:hello => 0, :world => 1}
//} -
Gem
:: Requirement # to _ s -> String (27325.0) -
条件を表す文字列を返します。
条件を表す文字列を返します。
//emlist[][ruby]{
req = Gem::Requirement.new(["< 5.0", ">= 1.9"])
p req.to_s # => "< 5.0, >= 1.9"
//} -
OpenStruct
# to _ h -> { Symbol => object } (27325.0) -
self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返 します。
self を各要素の名前をキー(Symbol)、要素が値のハッシュに変換して返
します。
//emlist[例][ruby]{
require 'ostruct'
data = OpenStruct.new("country" => "Australia", :capital => "Canberra")
data.to_h # => {:country => "Australia", :capital => "Canberra" }
//} -
REXML
:: Attribute # to _ string -> String (27325.0) -
"name='value'" という形式の文字列を返します。
"name='value'" という形式の文字列を返します。
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("el")
e.add_attribute("ns:r", "rval")
p e.attributes.get_attribute("r").to_string # => "ns:r='rval'"
//} -
Rake
:: TaskArguments # to _ hash -> Hash (27325.0) -
パラメータ名と対応する値を格納したハッシュを返します。
パラメータ名と対応する値を格納したハッシュを返します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash # => {:name1=>"value1", :name2=>"value2"}
end
//} -
RubyVM
:: InstructionSequence # to _ a -> Array (27325.0) -
self の情報を 14 要素の配列にして返します。
self の情報を 14 要素の配列にして返します。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンスのマイナーバージョン。
: format_type
データフォーマットを示す数値。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブ... -
Struct
# to _ a -> [object] (27325.0) -
構造体のメンバの値を配列にいれて返します。
構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してくだ... -
Struct
# to _ h -> Hash (27325.0) -
self のメンバ名(Symbol)と値の組を Hash にして返します。
self のメンバ名(Symbol)と値の組を Hash にして返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_h
# => {:name=>"Joe Smith", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています... -
Struct
# values -> [object] (27325.0) -
構造体のメンバの値を配列にいれて返します。
構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してくだ... -
TrueClass
# to _ s -> String (27325.0) -
常に文字列 "true" を返します。
常に文字列 "true" を返します。
//emlist[例][ruby]{
true.to_s # => "true"
//} -
URI
:: Generic # to _ s -> String (27325.0) -
自身が表す URI を文字列として返します。
自身が表す URI を文字列として返します。
例:
require 'uri'
p URI.parse('http://example.com/').to_s #=> "http://example.com/" -
UncaughtThrowError
# to _ s -> String (27325.0) -
self を tag を含む文字列表現にして返します。
self を tag を含む文字列表現にして返します。
//emlist[例][ruby]{
def do_complicated_things
throw :uncaught_label
end
begin
do_complicated_things
rescue UncaughtThrowError => ex
p ex.to_s # => "uncaught throw :uncaught_label"
end
//} -
Enumerator
# peek _ values -> Array (27322.0) -
Enumerator#next_values のように「次」のオブジェクトを 配列で返しますが、列挙状態を変化させません。
Enumerator#next_values のように「次」のオブジェクトを
配列で返しますが、列挙状態を変化させません。
Enumerator#next, Enumerator#next_values のように
現在までの列挙状態に応じて「次」のオブジェクトを返しますが、
next と異なり列挙状態を変更しません。
列挙が既に最後へ到達している場合は、StopIteration 例外を発生します。
このメソッドは Enumerator#next_values と同様
yield
と
yield nil
を区別するために使えます。
//emlist[例][ruby]{
o =... -
StopIteration
# result -> object (27322.0) -
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
この例外オブジェクトを発生させる原因となったメソッド等の返り値を返します。
object = Object.new
def object.each
yield :yield1
yield :yield2
:each_returned
end
enumerator = object.to_enum
p enumerator.next #=> :yield1
p enumerator.next #=> :yield2
begin
enumerator.next
rescue StopIteration => error
... -
Matrix
:: EigenvalueDecomposition # to _ a -> [Matrix , Matrix , Matrix] (27310.0) -
Matrix::EigenvalueDecomposition#v, Matrix::EigenvalueDecomposition#d, Matrix::EigenvalueDecomposition#v_inv をこの順に並べた配列を返します。
Matrix::EigenvalueDecomposition#v,
Matrix::EigenvalueDecomposition#d,
Matrix::EigenvalueDecomposition#v_inv
をこの順に並べた配列を返します。 -
Matrix
:: EigenvalueDecomposition # to _ ary -> [Matrix , Matrix , Matrix] (27310.0) -
Matrix::EigenvalueDecomposition#v, Matrix::EigenvalueDecomposition#d, Matrix::EigenvalueDecomposition#v_inv をこの順に並べた配列を返します。
Matrix::EigenvalueDecomposition#v,
Matrix::EigenvalueDecomposition#d,
Matrix::EigenvalueDecomposition#v_inv
をこの順に並べた配列を返します。