種類
ライブラリ
- English (120)
- ビルトイン (1152)
- benchmark (48)
-
cgi
/ core (48) - csv (48)
- date (88)
-
digest
/ sha1 (12) -
digest
/ sha2 (36) - drb (12)
- e2mmap (6)
- etc (414)
- fiddle (204)
-
fiddle
/ import (12) - fileutils (24)
-
irb
/ context (36) -
irb
/ input-method (60) - json (240)
-
json
/ add / date _ time (12) - logger (1)
- matrix (50)
-
minitest
/ spec (2) -
minitest
/ unit (2) - mkmf (72)
-
net
/ ftp (48) -
net
/ http (90) -
net
/ pop (36) -
net
/ protocol (24) -
net
/ smtp (12) - objspace (24)
- openssl (96)
- pathname (24)
- profiler (18)
- psych (38)
- rake (36)
-
rake
/ packagetask (12) -
rdoc
/ context (12) - resolv (12)
-
rexml
/ document (24) -
rubygems
/ dependency _ list (12) -
rubygems
/ exceptions (12) -
rubygems
/ package / tar _ reader (12) -
rubygems
/ package / tar _ reader / entry (12) -
rubygems
/ requirement (12) - socket (564)
- stringio (36)
- strscan (48)
- thread (2)
- thwait (12)
- time (96)
- timeout (8)
- tracer (24)
- tsort (12)
-
webrick
/ httpauth / authenticator (24) -
webrick
/ httpstatus (12) -
webrick
/ log (12) - win32ole (72)
- zlib (48)
クラス
-
ARGF
. class (36) - Array (153)
-
Benchmark
:: Tms (24) - CGI (36)
- CSV (24)
-
CSV
:: Row (12) -
CSV
:: Table (12) - Data (15)
- Date (2)
- DateTime (98)
- Encoding (48)
-
Encoding
:: Converter (60) - Enumerator (24)
-
Enumerator
:: Lazy (12) -
Fiddle
:: Pointer (48) -
Gem
:: DependencyList (12) -
Gem
:: Package :: TarReader :: Entry (12) - IO (112)
-
IRB
:: Context (36) -
IRB
:: InputMethod (12) -
IRB
:: ReadlineInputMethod (24) -
IRB
:: StdioInputMethod (24) - Integer (48)
-
JSON
:: State (72) - MatchData (56)
- Matrix (36)
- Method (12)
- Module (36)
-
Net
:: FTP (48) - Numeric (12)
- Object (74)
-
OpenSSL
:: PKey :: EC :: Group (24) -
OpenSSL
:: SSL :: SSLContext (12) - Pathname (24)
- Proc (12)
-
Psych
:: SyntaxError (12) -
RDoc
:: Context (12) -
REXML
:: DocType (24) -
Rake
:: FileList (24) -
Rake
:: PackageTask (12) -
Resolv
:: DNS :: Name (12) -
RubyVM
:: InstructionSequence (48) - Socket (276)
-
Socket
:: Option (12) - String (30)
- StringIO (36)
- StringScanner (48)
- Struct (22)
- Symbol (12)
- SystemCallError (12)
- Thread (24)
- Time (170)
- Tracer (24)
- Vector (14)
-
WEBrick
:: BasicLog (12) - WIN32OLE (24)
-
WIN32OLE
_ EVENT (12) -
WIN32OLE
_ METHOD (12) -
WIN32OLE
_ PARAM (12) -
Zlib
:: GzipReader (24)
モジュール
- Benchmark (24)
-
CGI
:: QueryExtension (12) - Etc (396)
- Fiddle (156)
-
Fiddle
:: Importer (12) -
File
:: Constants (12) - FileUtils (24)
-
GC
:: Profiler (48) - JSON (24)
- Kernel (240)
-
MiniTest
:: Assertions (2) - ObjectSpace (72)
-
OpenSSL
:: ASN1 (12) -
OpenSSL
:: OCSP (12) -
OpenSSL
:: SSL (24) -
OpenSSL
:: X509 (12) - Process (24)
-
Profiler
_ _ (18) - Psych (14)
-
RubyVM
:: AbstractSyntaxTree (10) -
Socket
:: Constants (276) - TSort (12)
-
WEBrick
:: HTTPAuth :: Authenticator (12) -
WEBrick
:: HTTPAuth :: ProxyAuthenticator (12)
キーワード
-
$ ARGV (12) -
$ DEFAULT _ INPUT (12) -
$ INPUT _ LINE _ NUMBER (12) -
$ LAST _ PAREN _ MATCH (12) -
$ LAST _ READ _ LINE (12) -
$ NR (12) -
$ OFS (12) -
$ ORS (12) -
$ OUTPUT _ FIELD _ SEPARATOR (12) -
$ OUTPUT _ RECORD _ SEPARATOR (12) -
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - === (24)
- APOPSession (12)
- Application (1)
- ArgumentError (12)
- Array (12)
-
CLOCK
_ PROF (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFF32 _ CFLAGS (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFF32 _ LDFLAGS (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFF32 _ LIBS (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFFBIG _ CFLAGS (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFFBIG _ LDFLAGS (12) -
CS
_ POSIX _ V6 _ ILP32 _ OFFBIG _ LIBS (12) -
CS
_ POSIX _ V6 _ LP64 _ OFF64 _ CFLAGS (12) -
CS
_ POSIX _ V6 _ LP64 _ OFF64 _ LDFLAGS (12) -
CS
_ POSIX _ V6 _ LP64 _ OFF64 _ LIBS (12) -
CS
_ POSIX _ V6 _ LPBIG _ OFFBIG _ CFLAGS (12) -
CS
_ POSIX _ V6 _ LPBIG _ OFFBIG _ LDFLAGS (12) -
CS
_ POSIX _ V6 _ LPBIG _ OFFBIG _ LIBS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFF32 _ CFLAGS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFF32 _ LDFLAGS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFF32 _ LIBS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFFBIG _ CFLAGS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFFBIG _ LDFLAGS (12) -
CS
_ POSIX _ V7 _ ILP32 _ OFFBIG _ LIBS (12) -
CS
_ POSIX _ V7 _ LP64 _ OFF64 _ CFLAGS (12) -
CS
_ POSIX _ V7 _ LP64 _ OFF64 _ LDFLAGS (12) -
CS
_ POSIX _ V7 _ LP64 _ OFF64 _ LIBS (12) -
CS
_ POSIX _ V7 _ LPBIG _ OFFBIG _ CFLAGS (12) -
CS
_ POSIX _ V7 _ LPBIG _ OFFBIG _ LDFLAGS (12) -
CS
_ POSIX _ V7 _ LPBIG _ OFFBIG _ LIBS (12) - ConditionVariable (12)
- DRbObject (12)
- E2MM (6)
- EOFError (12)
- EndOfYAMLException (12)
- ErrNoFinishedThread (6)
- Extend (12)
- FORMAT (24)
- FalseClass (12)
- FileList (12)
- Float (24)
- Group (9)
- HTTPClientException (7)
- HTTPGatewayTimeOut (7)
- HTTPMovedTemporarily (12)
- HTTPMultipleChoice (12)
- HTTPRequestEntityTooLarge (7)
- HTTPRequestTimeOut (7)
- HTTPRequestURITooLarge (12)
- HTTPRequestURITooLong (7)
- HTTPRequestedRangeNotSatisfiable (7)
- HTTPSession (12)
- Hash (12)
-
IFF
_ MASTER (24) -
IFF
_ NOTRAILERS (24) -
IFF
_ SLAVE (24) -
IFF
_ SUPP _ NOFCS (24) -
IPV6
_ RTHDR (24) -
IPV6
_ RTHDRDSTOPTS (24) -
IP
_ MTU (24) -
IP
_ ROUTER _ ALERT (24) -
IP
_ TOS (24) - InfoField (12)
- Integer (12)
-
MAX
_ MULTIPART _ COUNT (12) -
MAX
_ MULTIPART _ LENGTH (12) -
MSG
_ COMPAT (24) -
MSG
_ EOF (24) -
MSG
_ FLUSH (24) -
MSG
_ OOB (24) - Marshal フォーマット (12)
- Mutex (10)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 4 . 0 (9) -
NEWS for Ruby 3
. 1 . 0 (4) -
NI
_ NOFQDN (24) - NOFOLLOW (12)
- NilClass (12)
-
OP
_ MICROSOFT _ BIG _ SSLV3 _ BUFFER (12) -
OP
_ MICROSOFT _ SESS _ ID _ BUG (12) - Object (12)
- POP (12)
- POPSession (12)
- Parser (12)
- Passwd (9)
- ProtoFatalError (12)
- ProtocRetryError (12)
-
REVOKED
_ STATUS _ CESSATIONOFOPERATION (12) -
RLIMIT
_ NOFILE (12) - Requirement (12)
- ResponseInfoField (12)
-
SC
_ V6 _ ILP32 _ OFF32 (12) -
SC
_ V6 _ ILP32 _ OFFBIG (12) -
SC
_ V6 _ LP64 _ OFF64 (12) -
SC
_ V6 _ LPBIG _ OFFBIG (12) -
SC
_ V7 _ ILP32 _ OFF32 (12) -
SC
_ V7 _ ILP32 _ OFFBIG (12) -
SC
_ V7 _ LP64 _ OFF64 (12) -
SC
_ V7 _ LPBIG _ OFFBIG (12) -
SESSION
_ CACHE _ OFF (12) - SHA1 (12)
- SHA256 (12)
- SHA384 (12)
- SHA512 (12)
-
SIZEOF
_ CHAR (12) -
SIZEOF
_ DOUBLE (12) -
SIZEOF
_ FLOAT (12) -
SIZEOF
_ INT (12) -
SIZEOF
_ INTPTR _ T (12) -
SIZEOF
_ LONG (12) -
SIZEOF
_ LONG _ LONG (12) -
SIZEOF
_ PTRDIFF _ T (12) -
SIZEOF
_ SHORT (12) -
SIZEOF
_ SIZE _ T (12) -
SIZEOF
_ SSIZE _ T (12) -
SIZEOF
_ UINTPTR _ T (12) -
SIZEOF
_ VOIDP (12) -
SJIS
_ SOFTBANK (12) -
SJIS
_ SoftBank (12) - SMTPSession (12)
-
SO
_ BROADCAST (24) -
SO
_ OOBINLINE (24) -
SO
_ PEERCRED (24) -
SO
_ PEERNAME (24) - State (12)
- String (12)
-
TCP
_ KEEPCNT (24) -
TCP
_ LINGER2 (24) -
TCP
_ NOPUSH (24) -
TCP
_ SYNCNT (24) -
TCP
_ WINDOW _ CLAMP (24) - ThWait (6)
- TimeoutError (8)
- TrueClass (12)
-
UTF8
_ SOFTBANK (12) -
UTF8
_ SoftBank (12) - UnexpectedEOF (12)
-
V
_ ERR _ OUT _ OF _ MEM (12) -
WIN32OLE
_ TYPELIB (12) - ZStream (12)
- [] (46)
- []= (50)
- advise (12)
-
assert
_ instance _ of (1) -
assert
_ kind _ of (1) -
attribute
_ of (12) -
attributes
_ of (12) - autoload (24)
- autoload? (12)
-
base
_ label (12) - begin (12)
-
beginning
_ of _ line? (12) - benchmark (12)
- bigdecimal (12)
- binread (12)
- binwrite (24)
- bol? (12)
-
buffer
_ initial _ length (12) -
buffer
_ initial _ length= (12) - byteindex (3)
- byteoffset (6)
- byterindex (3)
-
check
_ circular? (12) -
check
_ signedness (24) -
check
_ sizeof (24) - chr (24)
- civil (12)
- class (12)
- coerce (12)
- cofactor (24)
-
cofactor
_ expansion (12) - combination (24)
- commercial (12)
-
const
_ set (12) -
convertible
_ int (24) -
copy
_ stream (12) - curry (12)
-
deconstruct
_ keys (17) -
defined
_ in? (12) - depth (12)
- depth= (12)
-
digest
/ sha1 (12) -
digest
/ sha2 (12) - digits (24)
-
each
_ object (48) - end (12)
-
end
_ with? (6) - eof (12)
- eof? (48)
- fatal (12)
- fetch (36)
-
first
_ lineno (12) - format (12)
- generate (12)
- getlocal (12)
- gets (12)
-
gmt
_ offset (12) - gmtoff (12)
-
handle
_ interrupt (12) - httpdate (24)
-
ignore
_ eof (12) -
ignore
_ eof= (12) -
ignore
_ eof? (12) -
instance
_ of? (12) -
irb
/ completion (12) -
is
_ a? (24) - iso8601 (12)
- jd (12)
-
kind
_ of? (24) - label (12)
-
laplace
_ expansion (12) - linger (12)
- localtime (12)
-
memsize
_ of (12) -
memsize
_ of _ all (12) -
must
_ be _ instance _ of (1) -
must
_ be _ kind _ of (1) -
net
/ imap (12) -
net
/ smtp (12) - new (78)
-
new
_ offset (12) - off (24)
-
off
_ event (12) - offset (48)
-
offset
_ vtbl (12) -
ole
_ activex _ initialize (12) -
ole
_ show _ help (12) - optparse (12)
- ordinal (12)
-
os
_ obj _ of (12) - output? (12)
- pack (21)
- pack テンプレート文字列 (12)
- permutation (24)
- pointer= (12)
- pos= (12)
- pread (8)
-
primitive
_ convert (48) -
primitive
_ errinfo (12) - print (12)
-
print
_ profile (6) - pwrite (8)
-
raw
_ data (12) -
rb
_ ary _ entry (12) -
rb
_ mod _ const _ of (12) -
rb
_ obj _ is _ instance _ of (12) -
rb
_ time _ timespec _ new (10) - rdoc (12)
-
rdoc
/ generator / json _ index (12) -
rdoc
/ parser / c (12) - read (12)
-
readable
_ atfer _ eof? (36) - readbyte (12)
- readchar (24)
- readline (24)
-
remove
_ entry _ secure (12) -
repeated
_ combination (24) -
repeated
_ permutation (24) - report (12)
- result (12)
- retrbinary (24)
- rfc2822 (24)
- rfc822 (24)
-
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 3 feature (12) -
ruby 1
. 8 . 4 feature (12) -
ruby2
_ keywords (12) -
rubygems
/ commands / generate _ index _ command (12) -
rubygems
/ commands / pristine _ command (12) -
rubygems
/ commands / specification _ command (12) -
rubygems
/ commands / uninstall _ command (12) -
rubygems
/ security (12) -
safe
_ load (14) - seek (48)
-
server
_ software (12) -
set
_ generator (12) - sizeof (12)
-
source
_ location (12) -
spec
_ predecessors (12) -
start
_ profile (6) -
start
_ with? (6) -
stop
_ profile (6) - storbinary (24)
- strftime (12)
-
subdomain
_ of? (12) - sysconf (12)
- sysseek (12)
-
test
/ unit (12) - timeofday (12)
-
to
_ f (12) -
to
_ json (12) -
total
_ time (12) - traverse (12)
-
tsort
_ each _ child (12) - unpack (12)
- unparse (12)
-
utc
_ offset (12) -
with
_ index (36) - write (24)
- xmlschema (12)
-
yaml
_ tag (12) - パターンマッチ (12)
検索結果
先頭5件
- static double timeofday(void)
- test
/ unit - RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node - RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence
-
static double timeofday(void) (32200.0)
-
-
test
/ unit (26030.0) -
ユニットテストを行うためのライブラリです。
...参照してください。
* Test::Unit - Ruby用単体テストフレームワーク: https://test-unit.github.io/
なお、2.2.0より前のtest/unit は当時バンドルしていた minitest/unit を使って再実装し
ていましたが、上記のtest/unitと完全な互換性がある......ィングフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html
=== 使い方
Test::Unit は以下のように使います。
まずテスト対象......テスト(test_foo.rb)を書きます。テストを実行するメソッド(テストメソッド)の名前は
全て test_ で始まる必要があります。テストメソッドが実行される前には setup メソッドが必ず
呼ばれます。実行されたあとには、teardown メ......史については以下が詳しくまとまっています。
* Rubyのテスティングフレームワークの歴史(2014年版) https://www.clear-code.com/blog/2014/11/6.html
* RubyKaigi 2015:The history of testing framework in Ruby https://www.clear-code.com/blog/2015/12/12.html... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (24314.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...list[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:44 (LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(metho......# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_init: nil
# rest: nil
# kw: nil
# kwrest: nil
# block: nil)
# body:
# (FCALL@6:2-6:21 :puts......(LIST@6:7-6:21 (STR@6:7-6:21 "hello, world") nil)))
//}......す。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#token が利用できます。
@param error_tolerant true を指定すると......所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:......LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (24214.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...す。
@param keep_script_lines true を指定すると、 Node#script_lines でノードと関連づけられたソースコードのテキストを取得できます。
@param keep_tokens true を指定すると、 Node#token が利用できます。
@param error_tolerant true を指定すると......所を type が :ERROR であるようなノードに置き換えてツリーを生成します。
//emlist[][ruby]{
pp RubyVM::AbstractSyntaxTree.of(proc {1 + 2})
# => (SCOPE@2:38-2:45
# tbl: []
# args: nil
# body:
# (OPCALL@2:39-2:44 (LIT@2:39-2:40 1) :+
# (LIST@2:43-2:......LIT@2:43-2:44 2) nil)))
def hello
puts "hello, world"
end
pp RubyVM::AbstractSyntaxTree.of(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5:9
# pre_num: 0
# pre_init: nil
# opt: nil
# first_post: nil
# post_num: 0
# post_... -
RubyVM
:: InstructionSequence . of(body) -> RubyVM :: InstructionSequence (21237.0) -
引数 body で指定した Proc、Method オブジェクトを元に RubyVM::InstructionSequence オブジェクトを作成して返します。
...Proc、Method オブジェクトを元に
RubyVM::InstructionSequence オブジェクトを作成して返します。
@param body Proc、Method オブジェクトを指定します。
例1:irb で実行した場合
# proc
> p = proc { num = 1 + 2 }
> RubyVM::InstructionSequence.of(p)
> #......nstructionSequence:block in irb_binding@(irb)>
# method
> def foo(bar); puts bar; end
> RubyVM::InstructionSequence.of(method(:foo))
> # => <RubyVM::InstructionSequence:foo@(irb)>
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/iseq_of.rb
def hello
puts......{ str = 'a' + 'b' }
# irb
> require '/tmp/iseq_of.rb'
# hello メソッド
> RubyVM::InstructionSequence.of(method(:hello))
> # => #<RubyVM::InstructionSequence:0x007fb73d7cb1d0>
# グローバル proc
> RubyVM::InstructionSequence.of($a_global_proc)
> # => #<RubyVM::InstructionS... -
FileUtils
. options _ of(mid) -> Array (15207.0) -
与えられたメソッド名で使用可能なオプション名の配列を返します。
...与えられたメソッド名で使用可能なオプション名の配列を返します。
@param mid メソッド名を指定します。
//emlist[][ruby]{
require 'fileutils'
FileUtils.options_of(:rm) # => ["noop", "verbose", "force"]
//}... -
Profiler
_ _ . # print _ profile(file) -> () (15200.0) -
stop_profile を実行し、プロファイルの結果を file に出力します。 file には printf メソッドが定義されていなければいけません。
...stop_profile を実行し、プロファイルの結果を file に出力します。
file には printf メソッドが定義されていなければいけません。
@param file File のインスタンスを指定します。... -
Profiler
_ _ . # start _ profile -> object (15200.0) -
プロファイルの取得を開始します。
プロファイルの取得を開始します。 -
Profiler
_ _ . # stop _ profile -> nil (15200.0) -
プロファイルの取得を停止します。
プロファイルの取得を停止します。 -
ThreadsWait
:: ErrNoFinishedThread (15000.0) -
nonblock がtrue でかつ、キューが空の時、発生します。
...nonblock がtrue でかつ、キューが空の時、発生します。
@see ThreadsWait#next_wait... -
MatchData
# byteoffset(n) -> [Integer , Integer] | [nil , nil] (12400.0) -
n 番目の部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。
...のオフセットの
配列 [start, end] を返します。
n番目の部分文字列がマッチしていなければ [nil, nil] を返します。
@param n 部分文字列を指定する数値
@raise IndexError 範囲外の n を指定した場合に発生します。
@see MatchData#offset... -
MatchData
# byteoffset(name) -> [Integer , Integer] | [nil , nil] (12400.0) -
name という名前付きグループに対応する部分文字列のバイト単位のオフセットの 配列 [start, end] を返します。
...name という名前付きグループに対応する部分文字列のバイト単位のオフセットの
配列 [start, end] を返します。
nameの名前付きグループにマッチした部分文字列がなければ
[nil, nil] を返します。
@param name 名前(シンボルか文字......ます。
//emlist[例][ruby]{
/(?<year>\d{4})年(?<month>\d{1,2})月(?:(?<day>\d{1,2})日)?/ =~ "2021年1月"
p $~.byteoffset('year') # => [0, 4]
p $~.byteoffset(:year) # => [0, 4]
p $~.byteoffset('month') # => [7, 8]
p $~.byteoffset(:month) # => [7, 8]
p $~.byteoffset('day') # =>......[nil, nil]
p $~.byteoffset('century') # => `offset': undefined group name reference: century (IndexError)
//}
@see MatchData#offset... -
VALUE rb
_ time _ timespec _ new(const struct timespec *ts , int offset) (12400.0) -
引数 ts、offset を元に Time オブジェクトを作成して返します。
...引数 ts、offset を元に Time オブジェクトを作成して返します。
@param ts timespec 構造体のポインタ
@param offset 協定世界時との時差(秒)。
-86400 < offset < 86400 の場合は指定した時差に、INT_MAX
を指定した場合は......地方時、INT_MAX-1 を指定した場合は UTC に
なります。
@raise ArgumentError offset に上述の範囲以外の値を指定した場合に発生し
ます。... -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (12325.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
...DTD 内の属性リスト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。
elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣......ement 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (comment)>
<!ELEMENT comment (#PCDATA)>
<!ATTLIST book
author CDATA #REQUIRED
title CDATA #R......EQUIRED
publisher CDATA "foobar publisher">
]>
EOS
p doctype.attribute_of("book", "publisher") # => "foobar publisher"
p doctype.attribute_of("bar", "foo") # => nil
p doctype.attribute_of("book", "baz") # => nil
p doctype.attribute_of("book", "title") # => nil
//}...