種類
ライブラリ
- English (11)
- ビルトイン (1230)
- base64 (11)
- benchmark (33)
- bigdecimal (7)
-
cgi
/ core (374) -
cgi
/ html (517) -
cgi
/ session (11) -
cgi
/ util (11) - csv (198)
- date (11)
- dbm (22)
- drb (11)
-
drb
/ acl (11) - e2mmap (12)
- erb (11)
- etc (165)
- fiddle (11)
- forwardable (11)
- gdbm (11)
- getoptlong (33)
- ipaddr (11)
- irb (11)
-
irb
/ context (220) -
irb
/ ext / save-history (11) - json (418)
-
json
/ add / bigdecimal (11) -
json
/ add / complex (11) -
json
/ add / date (11) -
json
/ add / date _ time (11) -
json
/ add / exception (11) -
json
/ add / ostruct (11) -
json
/ add / range (11) -
json
/ add / rational (11) -
json
/ add / regexp (11) -
json
/ add / struct (11) -
json
/ add / symbol (11) -
json
/ add / time (11) - kconv (143)
- logger (12)
-
minitest
/ unit (5) - mkmf (77)
-
net
/ ftp (33) -
net
/ http (110) -
net
/ imap (187) -
net
/ pop (11) -
net
/ smtp (11) - nkf (22)
- objspace (11)
- open-uri (70)
- openssl (396)
- optparse (495)
- pathname (11)
- psych (121)
- rake (99)
-
rake
/ packagetask (11) -
rake
/ rdoctask (11) -
rake
/ testtask (11) - rbconfig (44)
- rdoc (22)
-
rdoc
/ context (66) -
rdoc
/ generator / json _ index (11) -
rdoc
/ generator / ri (11) -
rdoc
/ markup (11) - readline (44)
- rexml (11)
-
rexml
/ document (165) - ripper (11)
-
ripper
/ filter (11) -
ripper
/ lexer (11) - rubygems (33)
-
rubygems
/ command (33) -
rubygems
/ commands / unpack _ command (11) -
rubygems
/ config _ file (33) -
rubygems
/ platform (11) -
rubygems
/ security (11) -
rubygems
/ specification (407) -
rubygems
/ user _ interaction (55) -
rubygems
/ version (33) - socket (121)
- stringio (22)
- strscan (33)
- syslog (11)
-
syslog
/ logger (11) - time (22)
- uri (44)
-
webrick
/ accesslog (11) -
webrick
/ config (11) -
webrick
/ httpauth / authenticator (22) -
webrick
/ httprequest (11) -
webrick
/ httpresponse (110) -
webrick
/ httpstatus (11) -
webrick
/ httpversion (11) - win32ole (11)
-
yaml
/ dbm (11) - zlib (77)
クラス
- ACL (11)
-
ARGF
. class (33) - Addrinfo (11)
- Array (44)
- BasicSocket (33)
-
Benchmark
:: Tms (11) - BigDecimal (18)
- Binding (6)
- CGI (33)
-
CGI
:: Session (11) - CSV (154)
-
CSV
:: Table (22) - Class (11)
- Complex (11)
- DBM (22)
-
DRb
:: DRbRemoteError (11) - Date (11)
- DateTime (22)
- ERB (11)
-
Encoding
:: Converter (143) -
Encoding
:: InvalidByteSequenceError (22) -
Encoding
:: UndefinedConversionError (22) - Exception (73)
-
Fiddle
:: Function (11) - GDBM (11)
-
Gem
:: Command (33) -
Gem
:: Commands :: UnpackCommand (11) -
Gem
:: ConfigFile (33) -
Gem
:: Platform (11) -
Gem
:: Security :: Policy (11) -
Gem
:: Specification (407) -
Gem
:: StreamUI (44) -
Gem
:: Version (22) - GetoptLong (33)
- IO (55)
- IPAddr (11)
-
IRB
:: Context (220) -
JSON
:: Parser (11) -
JSON
:: State (110) - Logger (11)
-
Logger
:: Application (1) - Method (11)
-
MiniTest
:: Unit (3) - Module (132)
-
Net
:: FTP (33) -
Net
:: HTTP (11) -
Net
:: HTTPResponse (88) -
Net
:: IMAP (11) -
Net
:: IMAP :: BodyTypeBasic (22) -
Net
:: IMAP :: BodyTypeMessage (22) -
Net
:: IMAP :: BodyTypeText (22) -
Net
:: IMAP :: ContentDisposition (22) -
Net
:: IMAP :: ContinuationRequest (11) -
Net
:: IMAP :: ResponseCode (11) -
Net
:: IMAP :: ResponseText (11) -
Net
:: IMAP :: TaggedResponse (33) -
Net
:: IMAP :: UntaggedResponse (22) -
Net
:: POP3 (11) -
Net
:: SMTP (11) - Object (135)
-
OpenSSL
:: ASN1 :: ObjectId (11) -
OpenSSL
:: Config (99) -
OpenSSL
:: OCSP :: Response (33) -
OpenSSL
:: SSL :: SSLContext (44) -
OpenSSL
:: SSL :: Session (44) -
OpenSSL
:: X509 :: Extension (55) -
OpenSSL
:: X509 :: ExtensionFactory (33) -
OpenSSL
:: X509 :: StoreContext (33) - OpenStruct (11)
- OptionParser (385)
-
OptionParser
:: ParseError (66) - Pathname (11)
- Proc (11)
-
Psych
:: Nodes :: Node (22) -
Psych
:: SyntaxError (11) -
Psych
:: Visitors :: YAMLTree (11) -
RDoc
:: Context (22) -
RDoc
:: Context :: Section (44) -
RDoc
:: Generator :: JsonIndex (11) -
RDoc
:: Generator :: RI (11) -
RDoc
:: Markup (11) -
RDoc
:: Options (198) -
REXML
:: Declaration (11) -
REXML
:: Document (33) -
REXML
:: Element (11) -
REXML
:: Instruction (22) -
REXML
:: NotationDecl (44) -
REXML
:: ParseException (11) -
REXML
:: XMLDecl (44) -
Rake
:: Application (33) -
Rake
:: InvocationChain (11) -
Rake
:: InvocationChain :: EmptyInvocationChain (11) -
Rake
:: PackageTask (11) -
Rake
:: RDocTask (11) -
Rake
:: Task (11) -
Rake
:: TestTask (11) - Range (11)
- Rational (33)
- Regexp (44)
- Ripper (22)
- RubyVM (11)
-
RubyVM
:: InstructionSequence (128) - SignalException (11)
- Socket (22)
-
Socket
:: Option (33) - String (217)
- StringIO (22)
- StringScanner (33)
- Struct (11)
- Symbol (43)
-
Syslog
:: Logger (11) -
Thread
:: Backtrace :: Location (66) - Time (55)
- UDPSocket (11)
-
URI
:: Generic (11) -
URI
:: LDAP (11) - UnboundMethod (22)
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPResponse (110) -
WEBrick
:: HTTPVersion (11) - WIN32OLE (11)
-
YAML
:: DBM (11) -
Zlib
:: Deflate (22) -
Zlib
:: Inflate (11)
モジュール
- Base64 (11)
- Benchmark (22)
-
CGI
:: HtmlExtension (517) -
CGI
:: QueryExtension (352) - Etc (165)
- Exception2MessageMapper (12)
-
File
:: Constants (11) - Forwardable (11)
- Gem (33)
-
Gem
:: InstallUpdateOptions (11) -
Gem
:: UserInteraction (11) - IRB (11)
- JSON (110)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (33) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kconv (132)
- Kernel (141)
-
MiniTest
:: Assertions (2) - NKF (22)
-
Net
:: HTTPHeader (11) - ObjectSpace (11)
- OpenSSL (33)
-
OpenSSL
:: Buffering (11) - OpenURI (11)
-
OpenURI
:: Meta (22) -
OpenURI
:: OpenRead (22) -
OptionParser
:: Arguable (44) - Psych (55)
- RDoc (22)
-
Rake
:: TaskManager (11) - RbConfig (44)
- Readline (44)
-
Socket
:: Constants (11) - Syslog (11)
- URI (29)
-
WEBrick
:: AccessLog (11) -
WEBrick
:: Config (11) -
WEBrick
:: HTTPAuth :: Authenticator (22) -
WEBrick
:: HTTPStatus (11) - Zlib (44)
キーワード
-
$ ERROR _ POSITION (11) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - === (11)
-
BENCHMARK
_ VERSION (11) - CAPTION (22)
-
COMMON
_ LOG _ FORMAT (11) -
CONSTANT
_ MODIFIERS (11) - Context (11)
- Converter (11)
-
DEFAULT
_ CONFIG _ FILE (11) -
DEFAULT
_ VERSION (11) - DEPRECATED (11)
- DESCRIPTION (11)
- DESTDIR (11)
- Extend (22)
-
FORWARDABLE
_ VERSION (11) - Filter (11)
- Float (6)
- HeaderConverters (11)
-
IDNAME
_ IVARS (11) -
INSTRUCTION
_ NAMES (11) - Integer (6)
- LIBDIR (11)
-
LIBYAML
_ VERSION (11) -
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 4 . 0 (8) -
NEWS for Ruby 2
. 5 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) -
NEWS for Ruby 3
. 1 . 0 (3) -
NI
_ NUMERICSERV (11) -
NKF
_ VERSION (11) -
NOPRINTING
_ IVARS (11) -
NO
_ INSPECTING _ IVARS (11) - NULL (11)
-
OPENSSL
_ LIBRARY _ VERSION (11) -
OPENSSL
_ VERSION (11) -
RFC822
_ MONTHS (11) -
RSTRING
_ LEN (11) -
RUBY
_ DESCRIPTION (11) -
RUBY
_ ENGINE _ VERSION (9) -
RUBY
_ REVISION (5) -
RUBY
_ VERSION (11) - ResponseField (11)
- ResponseInfoField (11)
- Revision (22)
- RubyGemsPackageVersion (11)
- RubyGemsVersion (11)
- Rubyの起動 (11)
-
SC
_ 2 _ VERSION (11) -
SC
_ ASYNCHRONOUS _ IO (11) -
SC
_ CLOCK _ SELECTION (11) -
SC
_ JOB _ CONTROL (11) -
SC
_ MEMORY _ PROTECTION (11) -
SC
_ MONOTONIC _ CLOCK (11) -
SC
_ NPROCESSORS _ CONF (11) -
SC
_ NPROCESSORS _ ONLN (11) -
SC
_ SYNCHRONIZED _ IO (11) -
SC
_ THREAD _ DESTRUCTOR _ ITERATIONS (11) -
SC
_ THREAD _ SAFE _ FUNCTIONS (11) -
SC
_ VERSION (11) -
SC
_ XOPEN _ VERSION (11) -
SEARCH
_ INDEX _ FILE (11) - SPECIAL (11)
-
SYSTEM
_ WIDE _ CONFIG _ FILE (11) - TOPDIR (11)
- VERSION (173)
- Version (33)
-
ZLIB
_ VERSION (11) - [] (44)
-
_ _ inspect _ _ (11) -
_ _ to _ s _ _ (11) -
_ dump (11) - a (22)
-
absolute
_ path (22) - accept (11)
-
accept
_ charset (11) -
accept
_ encoding (11) -
accept
_ language (11) -
add
_ value (11) - alert (11)
-
alert
_ error (11) -
alert
_ warning (11) -
allocation
_ sourcefile (11) -
ap
_ name (11) -
ap
_ name= (11) - appname (1)
-
arg
_ config (11) -
array
_ nl (11) -
ascii
_ only? (11) -
asciicompat
_ encoding (22) - ask (22)
-
auth
_ type (11) - autoload (22)
- autoload? (22)
- autorequire (11)
- backtrace (11)
- base (11)
-
base
_ label (22) - bindir (11)
- binread (22)
- blockquote (22)
- body (22)
- byteindex (2)
-
ca
_ file (11) -
ca
_ path (11) -
cache
_ control (11) - canonname (11)
- capitalize (16)
- capitalize! (8)
- cgi (11)
- charset (11)
- checkbox (22)
-
checkbox
_ group (22) - ciphers (11)
- clone (33)
- code (11)
- comment (11)
- compile (11)
-
compile
_ option (11) -
completion
_ append _ character (11) -
completion
_ append _ character= (11) -
completion
_ case _ fold (11) - concat (30)
-
config
_ file _ name (11) - confstr (11)
- connect (11)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ set (11) -
const
_ source _ location (5) - content (22)
-
content
_ encoding (11) -
content
_ id (33) -
content
_ length (11) -
content
_ length= (11) -
content
_ type (55) - context (11)
- convert (11)
-
create
_ body (11) -
create
_ ext _ from _ string (11) -
create
_ extension (22) -
create
_ header (11) -
create
_ id (11) - css (11)
- data (11)
- decode64 (11)
-
decode
_ www _ form _ component (11) -
default
_ argv (11) -
default
_ executable (11) -
define
_ singleton _ method (22) - deflate (22)
-
deprecate
_ constant (9) - desc (11)
- description (55)
-
destination
_ encoding _ name (22) -
dir
_ config (11) - disasm (22)
- disassemble (22)
- downcase (16)
- downcase! (8)
-
dsp
_ type (11) - dump (33)
- dup (22)
- email (11)
-
enable
_ config (22) - encode (33)
- encode! (22)
-
encode
_ www _ form _ component (11) - entity (11)
- environment (11)
- error= (11)
-
error
_ bytes (11) -
error
_ char (11) -
error
_ string (11) -
exception
_ details (1) - executable (11)
- executables (11)
- extensions (22)
-
extra
_ accessor _ flags (11) -
extra
_ rdoc _ files (11) -
fast
_ generate (11) -
fast
_ unparse (11) - fetch (11)
-
file
_ field (22) -
file
_ name (11) - filename (11)
- files (22)
- filter (33)
-
filter
_ backtrace (11) - finish (11)
- form (44)
- from (11)
-
full
_ gem _ path (11) -
full
_ name (11) -
gateway
_ interface (11) - generate (33)
-
generate
_ line (11) - get (11)
-
get
_ one _ gem _ name (11) -
get
_ one _ optional _ argument (11) -
get
_ option (11) -
get
_ path (11) -
get
_ value (11) - header (11)
- help (11)
- hidden (22)
-
history
_ file (11) - homepage (11)
- host (11)
- html (22)
- hton (11)
-
http
_ version (11) - id (11)
-
image
_ format (11) - img (22)
- indent (11)
- indent= (11)
-
insert
_ output (11) - inspect (88)
-
install
_ update _ defaults _ str (11) -
installation
_ path (11) - instance (22)
- investigation (11)
- irb (11)
-
irb
_ name (11) -
irb
_ name= (11) -
irb
_ path (11) - iseuc (11)
- isjis (11)
- iso8601 (11)
- issjis (11)
- isutf8 (11)
-
json
_ creatable? (11) -
json
_ create (11) - kconv (33)
- keys (11)
- label (22)
-
last
_ description (11) -
last
_ response (11) -
last
_ response _ code (11) - lastresp (11)
- lex (11)
-
lib
_ files (11) -
literal
_ concat _ string (11) -
load
_ from _ binary _ extra _ data (9) -
load
_ modules (11) -
loaded
_ from (11) - location (1)
-
long
_ name (11) -
main
_ page (11) -
mark
_ version (11) - markup (11)
-
marshal
_ version (11) -
module
_ function (19) - msg (11)
-
mu
_ pp (1) -
multipart
_ form (44) -
must
_ C _ version (11) - name (88)
- negotiate (11)
- new (99)
- normalize (11)
-
normalize
_ yaml _ input (11) -
object
_ nl (11) -
object
_ nl= (11) - oid (11)
-
op
_ dir (11) -
op
_ name (11) - open (70)
-
open
_ uri (11) -
option
_ string (11) - order (44)
- order! (44)
-
original
_ dir (11) -
original
_ name (11) -
original
_ platform (11) - out (11)
- param (11)
- params (11)
- parse (22)
- parse! (22)
-
parse
_ csv (11) - partition (11)
-
password
_ field (22) - path (33)
-
path
_ info (11) -
path
_ translated (11) - permute (22)
- permute! (22)
- platform (11)
- pragma (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
private
_ constant (11) -
program
_ name (11) -
prompt
_ c (11) -
prompt
_ i (11) -
prompt
_ n (11) -
prompt
_ s (11) -
psych
_ to _ yaml (11) - public (11)
-
public
_ constant (11) - puke (1)
- putback (22)
-
query
_ string (11) -
radio
_ group (22) -
rake
_ extension (11) - rakefile (11)
-
raw
_ data (33) -
rb
_ check _ convert _ type (11) -
rb
_ compile _ string (11) -
rb
_ eval _ string (11) -
rb
_ eval _ string _ protect (11) -
rb
_ eval _ string _ wrap (11) - rdoc (11)
-
rdoc
_ include (11) - read (11)
-
read
_ body (22) -
read
_ nonblock (44) - reason (22)
-
reason
_ phrase (22) -
recv
_ nonblock (11) -
recvfrom
_ nonblock (22) - recvmsg (11)
-
recvmsg
_ nonblock (11) - referer (11)
- release (11)
-
remote
_ addr (11) -
remote
_ host (11) -
remote
_ ident (11) -
remote
_ user (11) -
remove
_ const (11) - replacement (11)
- replacement= (11)
-
request
_ method (22) -
require
_ path (11) -
require
_ paths (11) - reset (22)
- responses (11)
-
return
_ format (11) - rpartition (11)
- ruby (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 3 feature (11) -
ruby 1
. 8 . 4 feature (11) -
rubygems
_ version (11) -
script
_ name (11) -
scrolling
_ list (22) - section (11)
- sections (11)
- select (11)
- sequence (11)
-
server
_ name (11) -
server
_ protocol (11) -
server
_ software (11) -
session
_ id (11) -
session
_ id _ context (11) -
set
_ backtrace (22) -
set
_ dictionary (22) -
set
_ encoding (22) -
signing
_ key (11) - signm (11)
-
singleton
_ class (11) -
singleton
_ method (11) - source (11)
-
source
_ location (39) - space (11)
- space= (11)
-
space
_ before (11) -
space
_ before= (11) -
ssl
_ version (11) -
stand
_ alone? (22) - standalone (11)
-
static
_ path (11) - status (11)
-
status
_ line (11) -
status
_ string (11) - strftime (11)
- submit (22)
- summary (11)
-
summary
_ indent (11) - swapcase (16)
- swapcase! (8)
- sysconfdir (11)
- system (11)
- tag (11)
- target (11)
- template (11)
-
template
_ dir (11) -
test
_ file (11) -
test
_ files (11) -
test
_ suite _ file (11) - text (11)
-
text
_ field (22) - textarea (22)
- title (22)
- title= (11)
-
to
_ a (22) -
to
_ binary (9) -
to
_ csv (22) -
to
_ der (33) -
to
_ json (242) -
to
_ json _ raw (11) -
to
_ json _ raw _ object (11) -
to
_ pem (11) -
to
_ r (11) -
to
_ ruby (11) -
to
_ s (198) -
to
_ text (11) -
to
_ yaml (22) - toeuc (11)
- tojis (11)
- tolocale (11)
- tosjis (11)
- toutf16 (11)
- toutf32 (11)
- toutf8 (11)
-
trusted
_ cert _ path (11) -
try
_ convert (22) - union (11)
-
unmatched
_ alias _ lists (11) - unpack (11)
- unparse (11)
- upcase (16)
- upcase! (8)
-
user
_ agent (11) - value (33)
- ver (11)
- verify (11)
- version (88)
- webcvs (11)
-
with
_ config (22) - write (22)
-
write
_ nonblock (22) - xmlschema (11)
- yaml (11)
-
zlib
_ version (11) - zone (22)
- 正規表現 (11)
検索結果
先頭5件
-
String
# partition(sep) -> [String , String , String] (27415.0) -
セパレータ sep が最初に登場する部分で self を 3 つに分割し、 [最初のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".partition("x") # => ["a", "x", "axa"]
p "aaaaa".partition("x") # => ["aaaaa", "", ""]
p "aaaaa".partition("") # => ["", "", "aaaaa"]
//}
@see String#rpartition, String#split... -
String
# rpartition(sep) -> [String , String , String] (27415.0) -
セパレータ sep が最後に登場する部分で self を 3 つに分割し、 [最後のセパレータより前の部分, セパレータ, それ以降の部分] の 3 要素の配列を返します。
...と第 2 要素が空文字列になります。
@param sep セパレータを表す文字列か正規表現を指定します。
//emlist[例][ruby]{
p "axaxa".rpartition("x") # => ["axa", "x", "a"]
p "aaaaa".rpartition("x") # => ["", "", "aaaaa"]
//}
@see String#partition, String#split... -
String
# kconv(out _ code , in _ code = Kconv :: AUTO) -> String (27301.0) -
self のエンコーディングを out_code に変換した文字列を 返します。 out_code in_code は Kconv の定数で指定します。
...self のエンコーディングを out_code に変換した文字列を
返します。
out_code in_code は Kconv の定数で指定します。
このメソッドは MIME エンコードされた文字列を展開し、
いわゆる半角カナを全角に変換します。
これらを変換......したくない場合は、 NKF.#nkf を使ってください。
@param out_code 変換後のエンコーディングを Kconv の定数で指定します。
@param in_code 変換する文字列のエンコーディングを Kconv の定数で指定します。
@see Kconv.#kconv... -
String
. try _ convert(obj) -> String | nil (27229.0) -
obj を String に変換しようと試みます。変換には Object#to_str メソッ ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ た場合は nil が返されます。
...obj を String に変換しようと試みます。変換には Object#to_str メソッ
ドが使われます。変換後の文字列を返すか、何らかの理由により変換できなかっ
た場合は nil が返されます。
@param obj 変換する任意のオブジェクト
@return......変換後の文字列または nil
//emlist[例][ruby]{
String.try_convert("str") # => "str"
String.try_convert(/re/) # => nil
//}... -
String
# ascii _ only? -> bool (27100.0) -
文字列がASCII文字のみで構成されている場合に true を返します。さもなくば false を返します。
...字列がASCII文字のみで構成されている場合に true を返します。さもなくば
false を返します。
例:
'abc123'.ascii_only? # => true
''.ascii_only? # => true
'日本語'.ascii_only? # => false
'日本語abc123'.ascii_only? # => false... -
String
# concat(other) -> self (24106.0) -
self に文字列 other を破壊的に連結します。 other が 整数である場合は other.chr(self.encoding) 相当の文字を末尾に追加します。
...追加します。
self を返します。
@param other 文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "string"
str.concat "XXX"
p str # => "stringXXX"
str << "YYY"
p str # => "stringXXXYYY"
str << 65 # 文字AのASCIIコード
p str # => "stringXXXYYYA"
//}... -
String
# concat(*arguments) -> self (24101.0) -
self に複数の文字列を破壊的に連結します。
...ding です。
self を返します。
@param arguments 複数の文字列もしくは 0 以上の整数
//emlist[例][ruby]{
str = "foo"
str.concat
p str # => "foo"
str = "foo"
str.concat "bar", "baz"
p str # => "foobarbaz"
str = "foo"
str.concat("!", 33, 33)
p str # => "foo!!!"
//}... -
OptionParser
# on(long , klass = String , desc = "") {|v| . . . } -> self (21347.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...なクラスを受け付けるかは、
以下の「デフォルトで利用可能な引数クラス」を参照して下さい。
OptionParser.accept や OptionParser#accept によって、受け付け
るクラスを増やすことができます。登録されていないクラスが指定され......きないものである場合、例外
OptionParser::InvalidArgument を投げます。
オプションの引数は accept で登録したブロックで klass のインスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.clas......用可能な引数クラス
: Object
オプションの引数は変換されません。
: String
オプションの引数は変換されません。ただし、空文字列を指定すると
OptionParser::InvalidArgument が発生します。
: Integer
Integer オブジェクトに変換さ... -
OptionParser
# on(short , long , klass = String , desc = "") {|v| . . . } -> self (21347.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...なクラスを受け付けるかは、
以下の「デフォルトで利用可能な引数クラス」を参照して下さい。
OptionParser.accept や OptionParser#accept によって、受け付け
るクラスを増やすことができます。登録されていないクラスが指定され......きないものである場合、例外
OptionParser::InvalidArgument を投げます。
オプションの引数は accept で登録したブロックで klass のインスタンス
に変換されてから、ブロックに渡されます。
opts.on("-w", "--width N", Integer){|w|
p w.clas......用可能な引数クラス
: Object
オプションの引数は変換されません。
: String
オプションの引数は変換されません。ただし、空文字列を指定すると
OptionParser::InvalidArgument が発生します。
: Integer
Integer オブジェクトに変換さ... -
OptionParser
# on(long , desc = "") {|v| . . . } -> self (21287.0) -
オプションを取り扱うためのブロックを自身に登録します。 ブロックはコマンドラインのパース時に、オプションが指定されていれば呼ばれます。
...ます。
opts.on("-r", "--require LIBRARY"){|lib| ...}
これは以下と同値です。
opts.on("-r LIBRARY"){|lib| ...}
opts.on("--require LIBRARY"){|lib| ...}
複数の異なるオプションに同じブロックを一度に登録することもできます。
opt.on('-v', '-vv'){|boo......lean| ...}
opt.on('--require X', '--need', '--dependon'){|x| ... }
@param short ショートオプションを表す文字列を指定します。
そのオプションが引数をとらない場合は、
//emlist{
on("-x"){|boolean| ...}
//}
となります。コマ......とる場合は、
//emlist{
on("-x MANDATORY"){|val| ...}
//}
となります。"MANDATORY" の部分は任意の文字列で構いません。
オプションの引数が必須でない場合は [ ] をつけて、
//emlist{
on("-x [OPTIONAL]"){|val| ...}
//}...