別のキーワード
クラス
-
ARGF
. class (84) - Array (1107)
- BasicObject (168)
- Binding (77)
- Class (40)
- Complex (57)
- Data (15)
- Dir (36)
- Encoding (24)
-
Encoding
:: Converter (120) -
Encoding
:: InvalidByteSequenceError (24) - Enumerator (132)
-
Enumerator
:: Lazy (178) -
Enumerator
:: Yielder (24) - Exception (56)
- FalseClass (24)
- Fiber (38)
-
File
:: Stat (276) - Float (152)
- FrozenError (6)
- Hash (837)
- IO (134)
- Integer (273)
- MatchData (94)
- Method (200)
- Module (688)
- Mutex (8)
- NilClass (36)
- Numeric (187)
- Object (777)
-
ObjectSpace
:: WeakMap (12) - Proc (80)
- Random (24)
- Range (307)
- Rational (48)
- Regexp (93)
-
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (130) - Set (33)
- String (1004)
- Struct (169)
- Symbol (71)
- Thread (206)
-
Thread
:: Backtrace :: Location (84) -
Thread
:: ConditionVariable (20) -
Thread
:: Mutex (40) -
Thread
:: Queue (50) -
Thread
:: SizedQueue (30) - Time (168)
- TracePoint (134)
- TrueClass (36)
- UnboundMethod (156)
- UncaughtThrowError (22)
モジュール
- Comparable (87)
- Enumerable (1424)
- GC (12)
キーワード
- ! (12)
- != (12)
- !~ (12)
- % (12)
- & (12)
- ** (11)
- + (24)
- < (58)
- << (50)
- <= (58)
- <=> (24)
- == (222)
- === (95)
- =~ (9)
- > (58)
- >= (58)
- >> (26)
- [] (180)
- []= (72)
- ^ (36)
-
_ _ id _ _ (12) -
_ _ send _ _ (24) -
_ dump (12) -
abort
_ on _ exception (12) -
abort
_ on _ exception= (12) - abs (57)
- abs2 (24)
-
absolute
_ path (24) -
add
_ trace _ func (12) -
alias
_ method (4) - alive? (4)
- all? (53)
- allbits? (8)
- allocate (12)
- any? (62)
- anybits? (8)
- append (8)
-
append
_ as _ bytes (1) - arity (24)
-
ascii
_ compatible? (12) - assoc (12)
- at (12)
- attr (12)
-
attr
_ accessor (4) -
attr
_ reader (4) -
attr
_ writer (4) - autoclose? (12)
- backtrace (24)
-
backtrace
_ locations (36) -
base
_ label (24) - begin (24)
- between? (12)
- bind (12)
-
bind
_ call (12) - binding (24)
- binmode (24)
- birthtime (12)
-
bit
_ length (12) - blksize (12)
- blockdev? (12)
- blocks (12)
- broadcast (10)
- bsearch (48)
-
bsearch
_ index (20) - bytebegin (2)
- byteend (2)
- byteindex (3)
- byteoffset (6)
- byterindex (3)
- bytes (36)
- bytesize (12)
- byteslice (36)
- call (24)
-
callee
_ id (12) - casecmp (12)
- casecmp? (18)
- casefold? (12)
- chain (7)
- chardev? (12)
- chars (12)
- children (7)
- chunk (12)
-
chunk
_ while (12) - clamp (15)
- class (12)
-
class
_ eval (24) -
class
_ exec (12) -
class
_ variable _ defined? (12) -
class
_ variable _ get (12) -
class
_ variable _ set (12) -
class
_ variables (12) - clone (24)
- closed? (34)
- codepoints (12)
- collect (36)
-
collect
_ concat (36) - combination (24)
- compact (13)
- compact! (9)
-
compare
_ by _ identity (12) -
compare
_ by _ identity? (12) - concat (18)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ set (12) -
const
_ source _ location (12) - constants (12)
- convert (12)
- count (48)
- cover? (19)
- curry (46)
- cycle (48)
- deconstruct (9)
- default (24)
-
define
_ method (24) -
define
_ singleton _ method (24) - delete (48)
-
delete
_ at (12) - deq (20)
- detect (24)
- dig (30)
- digits (12)
- directory? (12)
- disable (24)
- disasm (12)
- disassemble (12)
- disjoint? (3)
- display (12)
- drop (12)
-
drop
_ while (24) - dst? (12)
- dummy? (12)
- dump (12)
- dup (12)
- each (72)
-
each
_ byte (48) -
each
_ char (12) -
each
_ codepoint (12) -
each
_ cons (24) -
each
_ entry (24) -
each
_ grapheme _ cluster (8) -
each
_ key (24) -
each
_ pair (36) -
each
_ slice (24) -
each
_ value (24) -
each
_ with _ index (24) -
each
_ with _ object (24) - empty? (49)
- enable (24)
- encode (36)
- end (12)
-
end
_ with? (18) - entries (19)
-
enum
_ for (36) - eof (12)
- eof? (12)
- eql? (159)
- equal? (36)
-
error
_ bytes (12) - eval (24)
- even? (12)
- event (12)
- except (4)
-
exclude
_ end? (12) - executable? (12)
-
executable
_ real? (12) - extend (12)
-
extend
_ object (12) - extended (12)
- feed (12)
- fetch (80)
-
fetch
_ values (22) - file? (12)
- filter (49)
- filter! (28)
-
filter
_ map (12) - find (24)
-
find
_ all (24) -
find
_ index (36) - finish (12)
- finite? (30)
- first (60)
-
first
_ column (7) -
first
_ lineno (19) -
fixed
_ encoding? (12) -
flat
_ map (36) - force (12)
- freeze (12)
- friday? (12)
- frozen? (12)
-
garbage
_ collect (12) - getbyte (24)
- getc (12)
- gmt? (12)
-
grapheme
_ clusters (8) - grep (24)
-
grep
_ v (24) -
group
_ by (24) - grpowned? (12)
- gsub (48)
- gsub! (48)
-
has
_ key? (12) -
has
_ value? (12) - hash (48)
-
ignore
_ deadlock= (4) - include? (75)
-
incomplete
_ input? (12) - index (7)
- inherited (12)
- initialize (12)
-
initialize
_ copy (12) - inject (36)
- insert (12)
-
insert
_ output (12) - inspect (97)
-
instance
_ eval (24) -
instance
_ exec (12) -
instance
_ method (12) -
instance
_ methods (12) -
instance
_ of? (12) -
instance
_ variable _ defined? (12) -
instance
_ variable _ get (12) -
instance
_ variable _ set (12) -
instance
_ variables (12) -
instruction
_ sequence (7) - integer? (12)
- intern (12)
- intersect? (4)
- intersection (6)
- invert (12)
-
is
_ a? (12) - isatty (12)
- isdst (12)
- itself (12)
-
keep
_ if (48) - key (12)
- key? (24)
- keys (12)
-
kind
_ of? (12) - label (24)
- lambda? (12)
- last (36)
-
last
_ column (7) -
last
_ lineno (7) - lazy (12)
- lineno (12)
-
local
_ variable _ defined? (12) -
local
_ variable _ get (12) -
local
_ variable _ set (12) -
local
_ variables (11) - locked? (12)
- magnitude (57)
- map (36)
-
marshal
_ dump (12) -
marshal
_ load (12) - match (36)
- match? (27)
- max (130)
-
max
_ by (48) - member? (39)
- members (15)
- merge (24)
- merge! (24)
- method (12)
-
method
_ defined? (12) -
method
_ id (12) -
method
_ missing (12) - methods (12)
- min (130)
-
min
_ by (48) - minmax (48)
-
minmax
_ by (24) -
module
_ eval (24) -
module
_ exec (12) -
module
_ function (12) - monday? (12)
- name (41)
-
named
_ captures (12) - nan? (12)
- negative? (29)
- new (12)
- next (24)
- next! (12)
- nil? (12)
- nobits? (8)
- none? (53)
- nonzero? (12)
-
object
_ id (12) - oct (12)
- odd? (12)
- one? (53)
-
original
_ name (24) - overlap? (2)
- owned? (24)
- owner (12)
- pack (21)
- parameters (31)
- partition (24)
- path (24)
- peek (12)
- permutation (12)
- pipe? (12)
- pop (32)
- pos= (12)
- positive? (29)
- pow (22)
- pread (8)
- prepend (20)
-
prepend
_ features (12) -
primitive
_ convert (48) - priority (12)
- priority= (12)
- private (48)
-
private
_ instance _ methods (12) -
private
_ method _ defined? (12) -
proper
_ subset? (3) -
proper
_ superset? (3) -
protected
_ method _ defined? (12) - public (48)
-
public
_ class _ method (24) -
public
_ constant (12) -
public
_ instance _ method (12) -
public
_ method (12) -
public
_ method _ defined? (12) -
public
_ send (24) - push (12)
- putback (24)
- putc (12)
- raise (18)
- rassoc (12)
- readable? (12)
-
readable
_ real? (12) - readbyte (24)
- real? (12)
- receiver (29)
- reduce (36)
- regexp (12)
- rehash (12)
- reject (36)
-
remove
_ class _ variable (12) -
remove
_ const (12) -
remove
_ instance _ variable (12) -
repeated
_ combination (24) - replace (12)
- replacement= (12)
-
report
_ on _ exception (9) -
report
_ on _ exception= (9) -
respond
_ to? (12) -
respond
_ to _ missing? (12) - resume (12)
-
return
_ value (12) -
reverse
_ each (48) - rewind (12)
- rotate (12)
- rotate! (12)
-
ruby2
_ keywords (18) - sample (24)
- saturday? (12)
- scan (24)
- scrub (36)
- scrub! (36)
- seek (12)
- select (84)
- select! (48)
- self (12)
- send (24)
-
set
_ backtrace (12) -
set
_ encoding _ by _ bom (6) -
set
_ trace _ func (12) - setbyte (12)
- setgid? (12)
- setuid? (12)
- shift (44)
- signal (10)
-
singleton
_ class (12) -
singleton
_ class? (12) -
singleton
_ method (12) -
singleton
_ method _ added (12) -
singleton
_ method _ removed (12) -
singleton
_ method _ undefined (12) -
singleton
_ methods (12) - slice (92)
- slice! (48)
-
slice
_ after (35) -
slice
_ before (60) -
slice
_ when (23) - socket? (12)
- sort (48)
- sort! (24)
-
sort
_ by (24) -
sort
_ by! (24) -
source
_ location (19) - split (19)
-
start
_ with? (18) - step (62)
- sticky? (12)
- stop? (12)
- store (12)
- strftime (12)
- sub (36)
- sub! (36)
- subclasses (4)
- subsec (12)
- subset? (3)
- subtract (3)
- succ (12)
- succ! (12)
- sum (54)
- sunday? (12)
- superset? (3)
- sync (12)
- synchronize (12)
- tag (11)
- taint (9)
- tainted? (9)
- take (12)
-
take
_ while (48) - tally (10)
- tap (12)
- then (14)
-
thread
_ variable _ set (12) - thursday? (12)
-
to
_ a (55) -
to
_ ary (12) -
to
_ binary (10) -
to
_ enum (36) -
to
_ h (50) -
to
_ hash (12) -
to
_ i (12) -
to
_ int (12) -
to
_ proc (24) -
to
_ regexp (12) -
to
_ s (86) -
to
_ set (6) -
to
_ str (12) -
to
_ sym (12) - transfer (4)
-
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - trust (9)
-
try
_ lock (12) - tty? (12)
- tuesday? (12)
- type (7)
- unbind (12)
-
undef
_ method (12) -
unicode
_ normalized? (11) - union (7)
- uniq (24)
- unpack (12)
- unpack1 (9)
- unshift (12)
- untaint (9)
- untrust (9)
- untrusted? (9)
- update (24)
- upto (12)
- utc? (12)
-
valid
_ encoding? (12) - value (11)
- value? (12)
- values (24)
-
values
_ at (48) - wednesday? (12)
-
with
_ index (36) -
with
_ object (24) -
world
_ readable? (12) -
world
_ writable? (12) - writable? (12)
-
writable
_ real? (12) - yield (12)
-
yield
_ self (16) - zero? (36)
- zip (72)
- | (36)
検索結果
先頭5件
-
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (18365.0) -
For the given method names, marks the method as passing keywords through a normal argument splat. This should only be called on methods that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the method such that if the method is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the method to other methods.
...For the given method names, marks the method as passing keywords through
a normal argument splat. This should only be called on methods that
accept an argument splat (`*args`) but not explicit keywords or a
keyword splat. It marks the method such that if the method is called
with keyword argument......s will be passed through the method to
other methods.
This should only be used for methods that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility......ot exist in Ruby versions
before 2.7, check that the module responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
method will change so that it does not pass through keywords.
//emlist[例][ruby]{
module Mod
def foo(meth, *args, &block)... -
Proc
# ruby2 _ keywords -> proc (18365.0) -
Marks the proc as passing keywords through a normal argument splat. This should only be called on procs that accept an argument splat (`*args`) but not explicit keywords or a keyword splat. It marks the proc such that if the proc is called with keyword arguments, the final hash argument is marked with a special flag such that if it is the final element of a normal argument splat to another method call, and that method call does not include explicit keywords or a keyword splat, the final element is interpreted as keywords. In other words, keywords will be passed through the proc to other methods.
...Marks the proc as passing keywords through a normal argument splat. This
should only be called on procs that accept an argument splat (`*args`)
but not explicit keywords or a keyword splat. It marks the proc such
that if the proc is called with keyword arguments, the final hash
argument is marked......rds will
be passed through the proc to other methods.
This should only be used for procs that delegate keywords to another
method, and only for backwards compatibility with Ruby versions before
2.7.
This method will probably be removed at some point, as it exists only
for backwards compatibility.......s not exist in Ruby versions
before 2.7, check that the proc responds to this method before calling
it. Also, be aware that if this method is removed, the behavior of the
proc will change so that it does not pass through keywords.
//emlist[][ruby]{
module Mod
foo = ->(meth, *args, &block) do... -
String
# b -> String (18122.0) -
self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。
...self の文字エンコーディングを ASCII-8BIT にした文字列の複製を返します。
//emlist[例][ruby]{
'abc123'.encoding # => #<Encoding:UTF-8>
'abc123'.b.encoding # => #<Encoding:ASCII-8BIT>
//}... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (12133.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
...して返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソ......to_binary で得たバイナリデータは他のマシンに移動できません。他のバージョンや他のアーキテクチャのRubyで作られたバイナリデータは使用できません。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.to_bina......ry("extra_data")
# ※表示の都合上改行しているが実際は改行はない
# => "YARB\x02\x00\x00\x00\x03\x00\x00\x00\x16\x02\x00\x00\n\x00\x00\x00\x01
# \x00\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x84\x01\x00\x00\x88\x01\x00
# \x00\x02\x02\x00\x00x86_64-darwin15\x00*\x00\x00\x00\x00\x0... -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (12103.0) -
self が表す命令シーケンスの絶対パスを返します。
...ます。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello......puts "hello, world"
end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.absolute_path # => "/tmp/method.rb"
@see RubyVM::InstructionSequence#path... -
RubyVM
:: InstructionSequence # base _ label -> String (12103.0) -
self が表す命令シーケンスの基本ラベルを返します。
...す。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.base_label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello......# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.base_label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).base_label
# => "hello"
@see RubyVM::InstructionSequence#label... -
RubyVM
:: InstructionSequence # disassemble -> String (12103.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
...返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobject 2
0006 o......pt_plus <ic:1>
0008 leave
@see RubyVM::InstructionSequence.disasm... -
RubyVM
:: InstructionSequence # label -> String (12103.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
...す。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.rb
def hello
pu......end
# irb
> iseq = RubyVM::InstructionSequence.compile_file('/tmp/method.rb')
> iseq.label # => "<main>"
例3:
# /tmp/method2.rb
def hello
puts "hello, world"
end
RubyVM::InstructionSequence.of(method(:hello)).label
# => "hello"
@see RubyVM::InstructionSequence#base_label... -
Object
# object _ id -> Integer (9175.0) -
各オブジェクトに対して一意な整数を返します。あるオブジェクトに対し てどのような整数が割り当てられるかは不定です。
...す。
Rubyでは、(Garbage Collectされていない)アクティブなオブジェクト間で
重複しない整数(object_id)が各オブジェクトにひとつずつ割り当てられています。この
メソッドはその値を返します。
TrueClass, FalseClass, NilClass, Symbol, In......teger クラス
のインスタンスなど Immutable(変更不可)なオブジェクトの一部は同じ内容ならば必ず同じ object_id になります。
これは、Immutable ならば複数の場所から参照されても`破壊的操作'による問題が発生しないので、......emlist[][ruby]{
p "ruby".object_id #=> 60
p "ruby".object_id #=> 80
p [].object_id #=> 100
p [].object_id #=> 120
p :ruby.object_id #=> 710428
p :ruby.object_id #=> 710428
p 11.object_id #=> 23
p 11.object_id #=> 23
p true.object_id #=> 20
p true.object_id #=> 20
//}
@see Object#equal?,Symbol...