別のキーワード
種類
ライブラリ
- ビルトイン (15027)
-
shell
/ command-processor (12)
クラス
-
ARGF
. class (201) - Array (1044)
- BasicObject (154)
- Bignum (99)
- Binding (78)
- Class (58)
- Complex (118)
- Data (12)
- Dir (138)
- Encoding (472)
-
Encoding
:: Converter (110) -
Encoding
:: InvalidByteSequenceError (77) - Enumerator (139)
-
Enumerator
:: ArithmeticSequence (18) -
Enumerator
:: Chain (12) -
Enumerator
:: Lazy (181) -
Enumerator
:: Yielder (22) - Exception (58)
- FalseClass (22)
- Fiber (57)
- File (383)
-
File
:: Stat (253) - Fixnum (84)
- Float (139)
- FrozenError (5)
- Hash (797)
- IO (587)
- Integer (254)
- KeyError (14)
- LocalJumpError (22)
- MatchData (81)
- Method (181)
- Module (603)
- Mutex (8)
- NameError (29)
- NilClass (33)
- NoMethodError (19)
- Numeric (170)
- Object (1002)
-
ObjectSpace
:: WeakMap (22) - Proc (72)
-
Process
:: Status (66) - Random (39)
- Range (277)
- Rational (43)
- Regexp (129)
- RubyVM (34)
-
RubyVM
:: AbstractSyntaxTree :: Node (42) -
RubyVM
:: InstructionSequence (225) -
Shell
:: CommandProcessor (12) - SignalException (22)
- StopIteration (11)
- String (950)
- Struct (184)
- Symbol (382)
- SystemCallError (11)
- SystemExit (11)
- Thread (374)
-
Thread
:: Backtrace :: Location (77) -
Thread
:: ConditionVariable (36) -
Thread
:: Mutex (36) -
Thread
:: Queue (51) -
Thread
:: SizedQueue (61) - ThreadGroup (11)
- Time (154)
- TracePoint (165)
- TrueClass (33)
- UnboundMethod (163)
- UncaughtThrowError (20)
モジュール
- Comparable (79)
- Enumerable (1294)
-
File
:: Constants (44) - FileTest (270)
- GC (88)
-
GC
:: Profiler (33) - Kernel (703)
- Marshal (44)
- Math (33)
- ObjectSpace (110)
- Process (88)
-
Process
:: GID (33) -
Process
:: Sys (11) -
Process
:: UID (33) -
RubyVM
:: AbstractSyntaxTree (24) -
RubyVM
:: MJIT (18) - Warning (5)
キーワード
- ! (11)
- != (11)
- !~ (11)
-
$ -K (4) -
$ -a (11) -
$ -d (11) -
$ -l (11) -
$ -p (11) -
$ -v (11) -
$ -w (11) -
$ = (11) -
$ > (11) -
$ DEBUG (11) -
$ KCODE (4) -
$ SAFE (4) -
$ VERBOSE (11) -
$ stderr (11) -
$ stdin (11) -
$ stdout (11) - % (17)
- & (17)
- * (6)
- ** (17)
- + (28)
- - (6)
- -@ (3)
-
/ (6) - < (67)
- << (71)
- <= (67)
- <=> (25)
- == (234)
- === (98)
- =~ (20)
- > (67)
- >= (67)
- >> (29)
- ARGF (11)
- ARGV (11)
-
ASCII
_ 8BIT (11) - AbstractSyntaxTree (6)
- BIG5 (11)
-
BIG5
_ HKSCS (11) -
BIG5
_ HKSCS _ 2008 (11) -
BIG5
_ UAO (11) - BINARY (22)
- BasicObject (11)
- Big5 (11)
-
Big5
_ HKSCS (11) -
Big5
_ HKSCS _ 2008 (11) -
Big5
_ UAO (11) - Bignum (9)
- Binding (11)
-
CLOCK
_ BOOTTIME (11) -
CLOCK
_ BOOTTIME _ ALARM (11) -
CLOCK
_ MONOTONIC (11) -
CLOCK
_ PROCESS _ CPUTIME _ ID (11) -
CLOCK
_ REALTIME (11) - CP951 (11)
- Comparable (11)
- CompatibilityError (11)
- Complex (22)
- ConditionVariable (18)
- DATA (11)
- DEBUG (11)
- DEBUG= (11)
-
DEFAULT
_ PARAMS (11) - E2BIG (11)
- EBADE (11)
- EBADF (11)
- EBADFD (11)
- EBADMSG (11)
- EBADR (11)
- EBADRPC (11)
- EBADRQC (11)
- EBADSLT (11)
-
EBCDIC
_ CP _ US (9) - EBFONT (11)
- EBUSY (11)
- EFBIG (11)
- ELIBACC (11)
- ELIBBAD (11)
- ELIBEXEC (11)
- ELIBMAX (11)
- ELIBSCN (11)
- ENOBUFS (11)
- ENOTBLK (11)
- ENOTCAPABLE (10)
- ENOTRECOVERABLE (11)
- ENV (11)
- ETXTBSY (11)
- EWOULDBLOCK (11)
- Enumerable (11)
- FALSE (8)
-
FNM
_ EXTGLOB (11) - Fiber (11)
- FiberError (11)
- GB12345 (11)
- GB18030 (11)
- GB1988 (11)
- GBK (11)
- Hash (11)
- IBM037 (9)
- IBM437 (11)
- IBM720 (3)
- IBM737 (11)
- IBM775 (11)
- IBM850 (11)
- IBM852 (11)
- IBM855 (11)
- IBM857 (11)
- IBM860 (11)
- IBM861 (11)
- IBM862 (11)
- IBM863 (11)
- IBM864 (11)
- IBM865 (11)
- IBM866 (11)
- IBM869 (11)
-
INSTRUCTION
_ NAMES (11) -
INTERNAL
_ CONSTANTS (11) - InstructionSequence (11)
- Integer (11)
- InvalidByteSequenceError (11)
-
LOCK
_ NB (11) - Location (11)
- MJIT (6)
- Method (11)
- NIL (8)
- NONBLOCK (11)
- Node (6)
- OPTS (11)
- Object (11)
- ObjectSpace (11)
- Proc (11)
-
RLIMIT
_ SBSIZE (11) -
RUBY
_ COPYRIGHT (11) -
RUBY
_ DESCRIPTION (11) -
RUBY
_ ENGINE (11) -
RUBY
_ ENGINE _ VERSION (9) -
RUBY
_ PATCHLEVEL (11) -
RUBY
_ PLATFORM (11) -
RUBY
_ RELEASE _ DATE (11) -
RUBY
_ REVISION (11) -
RUBY
_ VERSION (11) - RubyVM (11)
-
SCRIPT
_ LINES _ _ (11) -
SJIS
_ SOFTBANK (11) -
SJIS
_ SoftBank (11) - STDERR (11)
- STDIN (11)
- STDOUT (11)
- String (11)
- Symbol (11)
-
TOPLEVEL
_ BINDING (11) - TRUE (8)
-
UCS
_ 2BE (11) -
UCS
_ 4BE (11) -
UTF8
_ SOFTBANK (11) -
UTF8
_ SoftBank (11) -
UTF
_ 16BE (11) -
UTF
_ 32BE (11) - UnboundMethod (11)
- WaitReadable (11)
- WaitWritable (11)
- WeakMap (11)
- [] (271)
- []= (66)
- ^ (39)
-
_ _ callee _ _ (11) -
_ _ id _ _ (11) -
_ _ method _ _ (11) -
_ _ send _ _ (22) -
_ dump (11) -
_ id2ref (11) - abort (44)
-
abort
_ on _ exception (22) -
abort
_ on _ exception= (22) - abs (58)
- abs2 (22)
-
absolute
_ path (33) -
absolute
_ path? (5) -
add
_ trace _ func (11) -
alias
_ method (3) - alive? (14)
- all? (47)
-
all
_ symbols (11) - allbits? (7)
- allocate (11)
- any? (56)
- anybits? (7)
- append (7)
- args (11)
- arity (22)
-
ascii
_ compatible? (11) -
ascii
_ only? (11) - assoc (11)
- at (11)
- attr (9)
-
attr
_ accessor (3) -
attr
_ reader (3) -
attr
_ writer (3) -
auto
_ compact (3) -
auto
_ compact= (3) - autoclose= (11)
- autoclose? (11)
- backtrace (22)
-
backtrace
_ locations (33) -
base
_ label (22) - basename (11)
- begin (28)
- between? (22)
- bind (11)
-
bind
_ call (10) - binding (33)
- binmode (22)
- binmode? (22)
- binread (11)
- binwrite (11)
- birthtime (31)
-
bit
_ length (17) - blksize (11)
-
block
_ given? (11) - blockdev? (33)
- blocks (11)
- broadcast (9)
- bsearch (44)
-
bsearch
_ index (18) - byteindex (2)
- byteoffset (4)
- byterindex (2)
- bytes (67)
- bytesize (11)
- byteslice (33)
- bytesplice (4)
- call (22)
-
callee
_ id (11) -
caller
_ locations (22) - capitalize (11)
- casecmp (11)
- casecmp? (16)
- casefold? (11)
- catch (22)
- cbrt (11)
- chain (6)
- chardev? (33)
- chars (11)
- chdir (22)
- children (6)
- chunk (11)
-
chunk
_ while (19) - clamp (24)
- class (11)
-
class
_ eval (22) -
class
_ exec (11) -
class
_ variable _ defined? (11) -
class
_ variable _ get (11) -
class
_ variable _ set (11) -
class
_ variables (11) - clone (33)
-
close
_ on _ exec= (11) -
close
_ on _ exec? (11) - closed? (31)
- codepoints (11)
- collect (33)
-
collect
_ concat (33) - combination (22)
- compact (11)
- compact! (8)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) - compatible? (11)
- compile (11)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - concat (16)
-
const
_ defined? (11) -
const
_ get (11) -
const
_ set (11) -
const
_ source _ location (5) - constants (22)
- convert (11)
- coredump? (11)
- count (44)
-
count
_ objects (11) - cover? (17)
- current (3)
- curry (42)
- cycle (44)
-
def
_ builtin _ commands (6) - default (22)
- define (2)
-
define
_ finalizer (22) -
define
_ method (44) -
define
_ singleton _ method (22) - delete (44)
-
delete
_ at (11) - deq (18)
-
destination
_ encoding (11) -
destination
_ encoding _ name (11) - detect (22)
- dig (27)
- digits (11)
- directory? (33)
- disable (44)
- disasm (22)
- disassemble (22)
- display (11)
- div (6)
- divmod (3)
- downcase (11)
- drop (11)
-
drop
_ while (22) - dst? (11)
- dummy? (11)
- dump (33)
- dup (11)
- each (72)
-
each
_ byte (66) -
each
_ char (11) -
each
_ codepoint (11) -
each
_ cons (22) -
each
_ entry (22) -
each
_ grapheme _ cluster (7) -
each
_ key (22) -
each
_ object (44) -
each
_ pair (33) -
each
_ slice (22) -
each
_ value (22) -
each
_ with _ index (22) -
each
_ with _ object (22) - empty? (95)
- enable (44)
- enabled? (28)
- enclosed? (11)
- encode (33)
- encoding (11)
- end (11)
-
end
_ with? (16) - enq (9)
- entries (17)
-
enum
_ for (33) - eof (22)
- eof? (22)
- eql? (148)
- equal? (44)
-
error
_ bytes (11) - eval (44)
- even? (17)
- event (11)
- except (3)
-
exclude
_ end? (17) - exclusive (11)
- executable? (33)
-
executable
_ real? (33) - exist? (33)
- exists? (27)
-
exit
_ value (11) - exited? (11)
- extend (11)
-
extend
_ object (11) - extended (11)
- fail (11)
- fdiv (3)
- feed (11)
- fetch (73)
-
fetch
_ values (18) - file? (33)
- filter (42)
- filter! (24)
-
filter
_ map (10) - find (22)
-
find
_ all (22) -
find
_ index (33) - finish (11)
- finite? (27)
- first (55)
-
first
_ column (6) -
first
_ lineno (17) -
fixed
_ encoding? (11) -
flat
_ map (33) - fnmatch (11)
- fnmatch? (11)
-
for
_ fd (11) - force (11)
- format (11)
- freeze (11)
- friday? (11)
- frozen? (11)
-
garbage
_ collect (22) - getbyte (33)
- getc (11)
- gets (11)
- glob (22)
-
global
_ variables (11) - gmt? (11)
-
grapheme
_ clusters (7) - grep (22)
-
grep
_ v (22) -
group
_ by (22) - grpowned? (33)
- gsub (77)
- gsub! (44)
-
handle
_ interrupt (11) -
has
_ key? (22) -
has
_ value? (22) - hash (47)
- id2name (11)
- identical? (22)
-
ignore
_ deadlock (3) -
ignore
_ deadlock= (3) - include? (77)
-
incomplete
_ input? (11) - index (7)
- inherited (11)
- initialize (11)
-
initialize
_ copy (11) - inject (33)
- insert (11)
-
insert
_ output (11) - inspect (105)
-
install
_ builtin _ commands (6) -
instance
_ eval (22) -
instance
_ exec (11) -
instance
_ method (11) -
instance
_ methods (11) -
instance
_ of? (11) -
instance
_ variable _ defined? (11) -
instance
_ variable _ get (11) -
instance
_ variable _ set (11) -
instance
_ variables (11) -
instruction
_ sequence (6) - integer? (11)
- intern (22)
- intersect? (3)
- intersection (5)
- invert (11)
- irb (8)
-
is
_ a? (11) - isatty (11)
- isdst (11)
- issetugid (11)
- iterator? (11)
- itself (11)
- join (11)
-
keep
_ if (44) - key (18)
- key? (33)
- keys (22)
-
keyword
_ init? (3) -
kind
_ of? (11) - label (22)
- lambda (17)
- lambda? (11)
- last (33)
-
last
_ column (6) -
last
_ lineno (6) -
last
_ match (22) -
latest
_ gc _ info (11) - lazy (11)
- length (11)
- lineno (11)
- lineno= (22)
- load (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) -
local
_ variable _ defined? (11) -
local
_ variable _ get (11) -
local
_ variable _ set (11) -
local
_ variables (30) - locked? (11)
- log (22)
- loop (11)
- magnitude (58)
- map (33)
-
marshal
_ dump (11) -
marshal
_ load (11) - match (44)
- match? (24)
- max (118)
-
max
_ by (44) - member? (44)
- members (26)
- merge (22)
- merge! (22)
- method (11)
-
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) - methods (11)
- min (118)
-
min
_ by (44) - minmax (42)
-
minmax
_ by (22) -
module
_ eval (22) -
module
_ exec (11) -
module
_ function (4) - modulo (6)
- monday? (11)
- name (48)
-
named
_ captures (11) - nan? (11)
- negative? (26)
- new (206)
- next (33)
- next! (11)
- nil? (22)
- nobits? (7)
- none? (47)
- nonzero? (11)
-
object
_ id (11) - oct (11)
- odd? (17)
- of (19)
- one? (47)
- open (77)
-
original
_ name (22) - owned? (44)
- owner (11)
- p (11)
- pack (19)
- parameters (39)
- parse (8)
-
parse
_ file (8) - partition (22)
- path (22)
- pause (6)
- peek (11)
-
pending
_ interrupt? (22) - permutation (11)
- pipe (88)
- pipe? (33)
- pop (29)
- popen (77)
- pos= (11)
- positive? (26)
- pow (22)
- pp (7)
- pread (7)
- prepend (18)
-
prepend
_ features (11) -
primitive
_ convert (44) - printf (22)
- priority (11)
- priority= (11)
- private (27)
-
private
_ call? (8) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
private
_ methods (11) - proc (18)
- protected (4)
-
protected
_ instance _ methods (11) -
protected
_ method _ defined? (11) -
protected
_ methods (11) - public (46)
-
public
_ class _ method (15) -
public
_ constant (11) -
public
_ instance _ method (11) -
public
_ instance _ methods (11) -
public
_ method (11) -
public
_ method _ defined? (11) -
public
_ methods (11) -
public
_ send (22) - push (20)
- putback (22)
- putc (33)
- puts (11)
- raise (37)
- rassoc (11)
-
re
_ exchangeable? (22) - read (11)
-
read
_ nonblock (22) - readable? (33)
-
readable
_ real? (33) -
readagain
_ bytes (11) - readbyte (22)
- readline (11)
- readlines (11)
- readpartial (22)
- real? (11)
- realdirpath (11)
- realpath (11)
- reason (11)
- receiver (42)
- reduce (33)
- regexp (11)
- rehash (11)
- reject (33)
- remainder (3)
-
remove
_ class _ variable (11) -
remove
_ const (11) -
remove
_ instance _ variable (11) -
repeated
_ combination (22) - replace (11)
- replacement= (11)
-
report
_ on _ exception (16) -
report
_ on _ exception= (8) - require (11)
-
require
_ relative (11) -
resolve
_ feature _ path (1) -
respond
_ to? (11) -
respond
_ to _ missing? (11) - restore (11)
- result (11)
- resume (17)
-
return
_ value (11) -
reverse
_ each (44) - rewind (17)
- rotate (11)
- rotate! (11)
-
ruby2
_ keywords (10) -
ruby2
_ keywords _ hash? (5) - sample (22)
- saturday? (11)
- scan (22)
- scrub (33)
- scrub! (33)
- seek (11)
- select (77)
- select! (44)
- self (11)
- send (22)
-
set
_ backtrace (11) -
set
_ encoding (66) -
set
_ encoding _ by _ bom (5) -
set
_ trace _ func (11) - setbyte (11)
- setgid? (33)
- setuid? (33)
- shift (40)
-
sid
_ available? (22) - signal (9)
- signaled? (11)
-
singleton
_ class (11) -
singleton
_ class? (11) -
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - size (14)
- slice (139)
- slice! (44)
-
slice
_ after (32) -
slice
_ before (55) -
slice
_ when (21) - socket? (33)
- sort (44)
- sort! (22)
-
sort
_ by (22) -
sort
_ by! (22) -
source
_ encoding (11) -
source
_ encoding _ name (11) -
source
_ location (17) - split (17)
- sprintf (11)
- srand (11)
-
start
_ with? (16) - stat (21)
- status (11)
- step (56)
- sticky? (33)
- stop (11)
- stop? (11)
- stopped? (11)
- store (11)
- stress (11)
- strftime (11)
- sub (55)
- sub! (33)
- subclasses (3)
- subsec (11)
- succ (25)
- succ! (11)
- success? (22)
- sum (49)
- sunday? (11)
-
super
_ method (10) - swapcase (11)
- switch (22)
- symlink? (22)
- sync (11)
- synchronize (11)
- sysread (11)
- system (44)
- tag (10)
- taint (9)
- tainted? (9)
- take (11)
-
take
_ while (44) - tally (8)
- tap (11)
- test (22)
- then (12)
-
thread
_ variable? (11) -
thread
_ variable _ get (11) -
thread
_ variable _ set (11) - thursday? (11)
-
to
_ a (50) -
to
_ ary (11) -
to
_ binary (9) -
to
_ enum (33) -
to
_ f (3) -
to
_ h (49) -
to
_ hash (11) -
to
_ i (11) -
to
_ int (11) -
to
_ io (11) -
to
_ proc (22) -
to
_ regexp (11) -
to
_ s (95) -
to
_ str (11) -
to
_ sym (22) -
to
_ tty? (7) - trace (11)
- transfer (3)
-
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - trust (9)
-
try
_ convert (58) -
try
_ lock (11) - tty? (11)
- tuesday? (11)
- type (6)
- unbind (11)
-
undef
_ method (11) -
undefine
_ finalizer (11) - ungetbyte (11)
-
unicode
_ normalized? (10) - union (17)
- uniq (22)
- unpack (11)
- unpack1 (8)
- unshift (11)
- untaint (9)
-
untrace
_ var (11) - untrust (9)
- untrusted? (9)
- upcase (11)
- update (22)
- upto (11)
-
used
_ modules (8) - utc? (11)
-
valid
_ encoding? (11) - value (21)
- value? (22)
- values (22)
-
values
_ at (44) -
verify
_ compaction _ references (5) - wait (9)
- wednesday? (11)
-
with
_ index (32) -
with
_ object (22) -
world
_ readable? (33) -
world
_ writable? (33) - writable? (33)
-
writable
_ real? (33) -
write
_ nonblock (11) - yield (22)
-
yield
_ self (14) - zero? (58)
- zip (66)
- | (39)
- ~ (6)
検索結果
先頭5件
-
Enumerator
# with _ object(obj) -> Enumerator (14200.0) -
繰り返しの各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
...の各要素に obj を添えてブロックを繰り返し、obj を返り値として返します。
obj には任意のオブジェクトを渡すことができます。
ブロックが渡されなかった場合は、上で説明した繰り返しを実行し、
最後に obj を返す Enumer......][ruby]{
# 0,1,2 と呼びだす enumeratorを作る
to_three = Enumerator.new do |y|
3.times do |x|
y << x
end
end
to_three_with_string = to_three.with_object("foo")
to_three_with_string.each do |x,string|
puts "#{string}: #{x}"
end
# => foo:0
# => foo:1
# => foo:2
//}
@param obj 繰り......返しの各要素に添えて渡されるオブジェクト
@see Enumerable#each_with_object... -
Exception
# backtrace _ locations -> [Thread :: Backtrace :: Location] (14200.0) -
バックトレース情報を返します。Exception#backtraceに似ていますが、 Thread::Backtrace::Location の配列を返す点が異なります。
...情報を返します。Exception#backtraceに似ていますが、
Thread::Backtrace::Location の配列を返す点が異なります。
現状では Exception#set_backtrace によって戻り値が変化する事はあり
ません。
//emlist[例: test.rb][ruby]{
require "date"
def check_long_......et_exception
return begin
yield
rescue => e
e
end
end
e = get_exception { check_long_month(2) }
p e.backtrace_locations
# => ["test.rb:4:in `check_long_month'", "test.rb:15:in `block in <main>'", "test.rb:9:in `get_exception'", "test.rb:15:in `<main>'"]
//}
@see Exception#backtrace... -
IO
# write _ nonblock(string , exception: true) -> Integer | :wait _ writable (14200.0) -
IO をノンブロッキングモードに設定し、string を write(2) システムコールで書き出します。
...り値)は String#bytesize の
値より小さい可能性があります。
発生した例外 がErrno::EAGAIN、 Errno::EWOULDBLOCK である場合は、
その例外オブジェクトに IO::WaitWritable が Object#extend
されます。よって IO::WaitWritable を write_nonblock のリトラ......列を指定します。
@param exception false を指定すると、書き込み時に Errno::EAGAIN、Errno::EWOULDBLOCK が発生
する代わりに :wait_writable を返します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します... -
Kernel
. # binding -> Binding (14200.0) -
変数・メソッドなどの環境情報を含んだ Binding オブジェクトを 生成して返します。通常、Kernel.#eval の第二引数として使います。
...変数・メソッドなどの環境情報を含んだ Binding オブジェクトを
生成して返します。通常、Kernel.#eval の第二引数として使います。
//emlist[例][ruby]{
def foo
a = 1
binding
end
eval("p a", foo) #=> 1
//}
@see Kernel.#eval,Object::TOPLEVEL_BINDING... -
Object
:: TOPLEVEL _ BINDING -> Binding (14200.0) -
トップレベルでの Binding オブジェクト。
...トップレベルでの Binding オブジェクト。
詳細は Binding を参照してください。... -
Proc
# binding -> Binding (14200.0) -
Proc オブジェクトが保持するコンテキストを Binding オブジェクトで返します。
...Proc オブジェクトが保持するコンテキストを
Binding オブジェクトで返します。
//emlist[例][ruby]{
def fred(param)
proc {}
end
sample_proc = fred(99)
eval("param", sample_proc.binding) # => 99
//}... -
RubyVM
:: InstructionSequence . load _ from _ binary(binary) -> RubyVM :: InstructionSequence (14200.0) -
RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
...RubyVM::InstructionSequence#to_binaryにより作られたバイナリフォーマットの文字列からiseqのオブジェクトをロードします。
このローダーは検証機構をもっておらず、壊れたり改変されたバイナリを読み込むと深刻な問題を引き起......りません。自分が変換したバイナリデータを使うべきです。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary
RubyVM::InstructionSequence.load_from_binary(binary).eval # => 3
//}
@see RubyVM::InstructionSequence#to_binary... -
RubyVM
:: InstructionSequence . load _ from _ binary _ extra _ data(binary) -> String (14200.0) -
バイナリフォーマットの文字列から埋め込まれたextra_dataを取り出します。
...埋め込まれたextra_dataを取り出します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
binary = iseq.to_binary("extra_data")
RubyVM::InstructionSequence.load_from_binary_extra_data(binary) # => extra_data
//}
@see RubyVM::InstructionSequence#to_binary... -
String
# byterindex(pattern , offset = self . bytesize) -> Integer | nil (14200.0) -
文字列のバイト単位のインデックス offset から左に向かって pattern を探索します。 最初に見つかった部分文字列の左端のバイト単位のインデックスを返します。 見つからなければ nil を返します。
...列または正規表現で指定します。
offset が負の場合は、文字列の末尾から数えた位置から探索します。
byterindex と String#byteindex とでは、探索方向だけが逆になります。
完全に左右が反転した動作をするわけではありません......mlist[String#byteindex の場合][ruby]{
p "stringstring".byteindex("ing", 1) # => 3
# ing # ここから探索を始める
# ing
# ing # 右にずらしていってここで見つかる
//}
//emlist[String#byterindex の場合][ruby]{
p "stringstring".byterindex("in......例][ruby]{
'foo'.byterindex('f') # => 0
'foo'.byterindex('o') # => 2
'foo'.byterindex('oo') # => 1
'foo'.byterindex('ooo') # => nil
'foo'.byterindex(/f/) # => 0
'foo'.byterindex(/o/) # => 2
'foo'.byterindex(/oo/) # => 1
'foo'.byterindex(/ooo/) # => nil
# 右でのマッチが優先
'foo'.byterind... -
String
# bytes {|byte| . . . } -> self (14200.0) -
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
...で返します。(self.each_byte.to_a と同じです)
//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}
ブロックが指定された場合は String#each_byte と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除さ......れました。
@see String#each_byte... -
String
# each _ byte {|byte| . . . } -> self (14200.0) -
文字列の各バイトに対して繰り返します。
...文字列の各バイトに対して繰り返します。
//emlist[例][ruby]{
"str".each_byte do |byte|
p byte
end
# => 115
# => 116
# => 114
"あ".each_byte do |byte|
p byte
end
# => 227
# => 129
# => 130
//}
@see String#bytes...