クラス
- Array (55)
- Class (22)
- Complex (33)
- Data (14)
- Dir (378)
- Encoding (110)
-
Encoding
:: Converter (66) - Enumerator (23)
-
Enumerator
:: Chain (6) -
Enumerator
:: Lazy (11) -
Errno
:: EXXX (22) - Exception (29)
- Fiber (25)
- File (708)
-
File
:: Stat (11) - FrozenError (12)
- Hash (60)
- IO (473)
- Integer (10)
- KeyError (24)
- Module (52)
- Mutex (2)
- NameError (17)
- NoMethodError (17)
- Object (11)
- Proc (18)
- Random (114)
- Range (11)
- Regexp (88)
- RubyVM (1)
-
RubyVM
:: InstructionSequence (95) - SignalException (33)
- String (39)
- Struct (58)
- Symbol (11)
- SystemCallError (44)
- SystemExit (11)
- Thread (192)
-
Thread
:: ConditionVariable (9) -
Thread
:: Mutex (9) -
Thread
:: Queue (12) -
Thread
:: SizedQueue (9) - ThreadGroup (11)
- Time (171)
- TracePoint (32)
モジュール
- GC (112)
-
GC
:: Profiler (88) - Process (95)
-
RubyVM
:: AbstractSyntaxTree (24) -
RubyVM
:: MJIT (18) - Warning (18)
キーワード
- === (11)
- DEBUG (11)
- DEBUG= (11)
- [] (75)
- []= (5)
- abort (22)
-
abort
_ on _ exception (11) -
absolute
_ path (11) -
absolute
_ path? (5) - aliases (11)
-
all
_ symbols (11) -
asciicompat
_ encoding (22) - assoc (11)
- at (47)
- atime (11)
-
auto
_ compact (3) - basename (11)
- binread (11)
- binwrite (11)
- birthtime (10)
- blockdev? (11)
- bytes (6)
- chardev? (11)
- chdir (44)
- children (14)
- chmod (11)
- chown (11)
- chroot (11)
- clear (22)
- clone (11)
- compact (5)
- compatible? (11)
- compile (22)
-
compile
_ file (11) -
compile
_ option (11) - constants (11)
-
copy
_ stream (22) - count (11)
- ctime (11)
- current (14)
-
default
_ external (11) -
default
_ external= (11) -
default
_ internal (11) -
default
_ internal= (11) - define (4)
-
define
_ method (22) - delete (44)
-
delete
_ if (22) - directory? (11)
- dirname (11)
- disable (22)
- disasm (11)
- disassemble (11)
- dup (3)
- each (22)
-
each
_ child (28) -
each
_ key (22) -
each
_ pair (22) -
each
_ value (22) - empty? (27)
- enable (22)
- enabled? (17)
- entries (22)
- escape (11)
- except (3)
- exception (11)
- exclusive (11)
- exec (11)
- executable? (11)
-
executable
_ real? (11) - exist? (22)
- exists? (18)
- exit (22)
- exit! (11)
- extname (11)
- fetch (33)
- file? (11)
- filter (12)
- filter! (12)
- find (11)
- fnmatch (11)
- fnmatch? (11)
-
for
_ fd (11) - foreach (66)
- fork (33)
- freeze (5)
- ftype (11)
- getwd (11)
- glob (22)
- gm (22)
- grpowned? (11)
-
handle
_ interrupt (11) -
has
_ key? (11) -
has
_ value? (11) - home (22)
- identical? (11)
- include (11)
- include? (11)
- index (7)
- inspect (22)
- invert (11)
- join (11)
-
keep
_ if (22) - key (11)
- key? (11)
- keys (11)
-
keyword
_ init? (3) - kill (11)
-
last
_ match (22) -
last
_ status (7) -
latest
_ gc _ info (22) - lchmod (11)
- lchown (11)
- left (11)
- length (11)
- link (11)
- list (22)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - local (22)
-
locale
_ charmap (11) - lstat (11)
- lutime (7)
- main (11)
- member? (11)
- members (13)
- merge! (10)
- mkdir (11)
- mkfifo (9)
- mktime (22)
- mtime (11)
-
name
_ list (11) - nesting (11)
- new (650)
-
new
_ seed (11) - now (11)
- of (19)
- open (88)
- owned? (11)
- parse (8)
-
parse
_ file (8) - pass (11)
- path (11)
- pause (6)
-
pending
_ interrupt? (11) - pipe (88)
- pipe? (11)
- polar (11)
- popen (154)
- private (23)
- produce (5)
- public (23)
- pwd (11)
- quote (11)
- rand (33)
- rassoc (11)
-
raw
_ data (11) -
raw
_ seed (2) - read (33)
- readable? (11)
-
readable
_ real? (11) - readlines (33)
- readlink (11)
- realdirpath (11)
- realpath (11)
- rect (11)
- rectangular (11)
- rehash (11)
- reject (22)
- reject! (22)
- rename (11)
- replace (11)
- report (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
resolve
_ feature _ path (1) - result (11)
- resume (6)
- rmdir (11)
-
ruby2
_ keywords _ hash? (5) -
search
_ convpath (11) - select (33)
- select! (22)
- setgid? (11)
- setuid? (11)
- shift (11)
- size (22)
- size? (11)
- slice (6)
- socket? (11)
- spawn (11)
- split (11)
- sqrt (7)
- srand (22)
- start (22)
- stat (43)
- state (11)
- sticky? (11)
- stop (11)
- store (11)
- stress (11)
- symlink (11)
- symlink? (11)
- sysopen (11)
-
to
_ a (11) -
to
_ h (17) -
to
_ hash (11) -
to
_ s (22) -
to
_ tty? (7) -
total
_ time (11) - trace (11)
- truncate (11)
-
try
_ convert (58) - umask (22)
- union (11)
- unlink (22)
- update (22)
- urandom (7)
-
used
_ modules (8) - using (11)
- utc (22)
- utime (11)
- value? (11)
- values (11)
-
values
_ at (11) -
verify
_ compaction _ references (5) - warn (8)
-
world
_ readable? (11) -
world
_ writable? (11) - writable? (11)
-
writable
_ real? (11) - write (22)
- yield (11)
- zero? (11)
検索結果
先頭5件
- Encoding
:: Converter . search _ convpath(source _ encoding , destination _ encoding , options) -> Array - Encoding
:: Converter . new(convpath) -> Encoding :: Converter - Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter - Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter - Time
. at(time) -> Time
-
Encoding
:: Converter . search _ convpath(source _ encoding , destination _ encoding , options) -> Array (283.0) -
引数で指定した文字エンコーディングの変換の経路を配列にして返します。
...ch_convpath("ISO-8859-1", "EUC-JP")
# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>]]
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "EUC-JP", newline: :u......# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:EUC-JP>],
# "universal_newline"]
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", universal_newline: true)
# or
p Encoding::Converter.search_convpath("ISO-8859-1", "UTF-32BE", newline: :unive......rsal)
# => [[#<Encoding:ISO-8859-1>, #<Encoding:UTF-8>],
# "universal_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-32BE>]]
//}
@see Encoding::Converter#convpath, Encoding::Converter.new... -
Encoding
:: Converter . new(convpath) -> Encoding :: Converter (223.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding) -> Encoding :: Converter (223.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Encoding
:: Converter . new(source _ encoding , destination _ encoding , options) -> Encoding :: Converter (223.0) -
Encoding::Converter オブジェクトを作成します。
...t[][ruby]{
# UTF-16BE to UTF-8
ec = Encoding::Converter.new("UTF-16BE", "UTF-8")
# Usually, decorators such as newline conversion are inserted last.
ec = Encoding::Converter.new("UTF-16BE", "UTF-8", :universal_newline => true)
p ec.convpath #=> [[#<Encoding:UTF-16BE>, #<Encoding:UTF-8>],......verter.new("UTF-8", "UTF-16BE", :crlf_newline => true)
p ec.convpath #=> ["crlf_newline",
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
# Conversion path can be specified directly.
ec = Encoding::Converter.new(["universal_newline", ["EUC-JP", "UTF-8"], ["UTF-8", "UTF-16BE"]])
p ec.c......onvpath #=> ["universal_newline",
# [#<Encoding:EUC-JP>, #<Encoding:UTF-8>],
# [#<Encoding:UTF-8>, #<Encoding:UTF-16BE>]]
//}... -
Time
. at(time) -> Time (211.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(......e.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).......0000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899, in: "C") # => 2020-02-26 13:58:19 +0300
//}... -
Time
. at(time , in:) -> Time (211.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
"UTC" かミリタリータイムゾーンの文字列または
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(......e.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).......0000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
Time.at(1582721899, in: "UTC") # => 2020-02-26 12:58:19 UTC
Time.at(1582721899, in: "C") # => 2020-02-26 13:58:19 +0300
//}... -
Time
. at(time) -> Time (187.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(T......# => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19......+0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Time
. at(time , in:) -> Time (187.0) -
time で指定した時刻の Time オブジェクトを返します。
...@param in "+HH:MM" や "-HH:MM" のような形式の文字列か
数値でタイムゾーンを指定します。
//emlist[][ruby]{
Time.at(0) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(T......# => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31 15:00:00 +0900
Time.at(946684800.2).usec # => 200000
Time.at(1582721899, in: "+09:00") # => 2020-02-26 21:58:19......+0900
Time.at(1582721899, in: 9*60*60) # => 2020-02-26 21:58:19 +0900
//}... -
Encoding
. list -> [Encoding] (181.0) -
現在ロードされているエンコーディングのリストを返します。
...coding:ASCII-8BIT>, #<Encoding:EUC-JP>,
# #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
# #<Encoding:ISO-2022-JP (dummy)>]
Encoding.find("US-ASCII")
# => #<Encoding:US-ASCII>
Encoding.list
# => [#<Encoding:ASCII-8BIT>, #<Encoding:EUC-JP>,
# #<Encoding:Shift_JIS>, #<Encoding:UTF-8>,
# #......<Encoding:US-ASCII>, #<Encoding:ISO-2022-JP (dummy)>]
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string) -> RubyVM :: AbstractSyntaxTree :: Node (181.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)
# => (SCOPE@1:0-1:15
# tbl: [:x, :......y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
RubyVM
:: AbstractSyntaxTree . parse(string , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (181.0) -
文字列を抽象構文木にパースし、その木の根ノードを返します。
...1 + 2")
# => (SCOPE@1:0-1:9
# tbl: [:x]
# args: nil
# body:
# (LASGN@1:0-1:9 :x
# (OPCALL@1:4-1:9 (LIT@1:4-1:5 1) :+ (LIST@1:8-1:9 (LIT@1:8-1:9 2) nil))))
pp RubyVM::AbstractSyntaxTree.parse("x = 1; p(x; y=2", error_tolerant: true)
# => (SCOPE@1:0-1:15
# tbl: [:x, :......y]
# args: nil
# body: (BLOCK@1:0-1:15 (LASGN@1:0-1:5 :x (LIT@1:4-1:5 1)) (ERROR@1:7-1:11) (LASGN@1:12-1:15 :y (LIT@1:14-1:15 2))))
//}... -
RubyVM
:: AbstractSyntaxTree . of(proc) -> RubyVM :: AbstractSyntaxTree :: Node (163.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...8-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(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5......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)))
//}... -
RubyVM
:: AbstractSyntaxTree . of(proc , keep _ script _ lines: false , error _ tolerant: false , keep _ tokens: false) -> RubyVM :: AbstractSyntaxTree :: Node (163.0) -
引数 proc に渡したProcやメソッドオブジェクトの抽象構文木を返します。
...8-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(method(:hello))
# => (SCOPE@5:0-7:3
# tbl: []
# args:
# (ARGS@5:9-5......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)))
//}... -
Time
. at(time) -> Time (163.0) -
time で指定した時刻の Time オブジェクトを返します。
...970-01-01 09:00:00 +0900
Time.at(Time.at(0)) # => 1970-01-01 09:00:00 +0900
Time.at(Time.at(0).getutc) # => 1970-01-01 00:00:00 UTC
Time.at(946702800) # => 2000-01-01 14:00:00 +0900
Time.at(-284061600) # => 1960-12-31... -
Encoding
. compatible?(obj1 , obj2) -> Encoding | nil (151.0) -
2つのオブジェクトのエンコーディングに関する互換性をチェックします。 互換性がある場合はそのエンコーディングを、 ない場合は nil を返します。
...ます。
//emlist[例][ruby]{
Encoding.compatible?("\xa1".force_encoding("iso-8859-1"), "b")
#=> #<Encoding:ISO-8859-1>
Encoding.compatible?(
"\xa1".force_encoding("iso-8859-1"),
"\xa1\xa1".force_encoding("euc-jp"))
#=> nil
//}
引数が文字列でない場合でも、両方のオブジェ......ことができます。
//emlist[例][ruby]{
Encoding.compatible?(Encoding::UTF_8, Encoding::CP932)
# => nil
Encoding.compatible?(Encoding::UTF_8, Encoding::US_ASCII)
# => #<Encoding:UTF-8>
//}
@param obj1 チェック対象のオブジェクト
@param obj2 チェック対象のオブジェクト... -
Encoding
:: Converter . asciicompat _ encoding(encoding) -> Encoding | nil (151.0) -
同じ文字集合を持つ ASCII 互換エンコーディングを返します。
...ングでない場合は nil を返します。
//emlist[][ruby]{
Encoding::Converter.asciicompat_encoding("ISO-2022-JP") #=> #<Encoding:stateless-ISO-2022-JP>
Encoding::Converter.asciicompat_encoding("UTF-16BE") #=> #<Encoding:UTF-8>
Encoding::Converter.asciicompat_encoding("UTF-8") #=> nil
//}...