別のキーワード
ライブラリ
- ビルトイン (749)
- bigdecimal (7)
- csv (18)
- drb (1)
- erb (4)
- fiddle (2)
-
fiddle
/ import (3) -
io
/ wait (2) -
irb
/ cmd / help (1) -
irb
/ cmd / load (3) -
irb
/ context (2) -
irb
/ xmp (1) - json (6)
-
json
/ add / struct (1) - kconv (1)
- logger (17)
- matrix (37)
- mkmf (2)
- monitor (1)
-
net
/ http (23) - open-uri (8)
- openssl (8)
- optparse (26)
- ostruct (2)
- pathname (15)
- prime (8)
- psych (6)
- rake (18)
-
rake
/ testtask (2) -
rdoc
/ parser / ruby (1) - resolv (2)
-
rexml
/ document (38) - rubygems (1)
-
rubygems
/ commands / update _ command (1) -
rubygems
/ custom _ require (1) -
rubygems
/ requirement (11) -
rubygems
/ specification (10) -
rubygems
/ version (2) - set (19)
- socket (1)
- stringio (6)
- strscan (11)
- tsort (3)
- un (1)
- uri (3)
-
webrick
/ httprequest (1) - win32ole (3)
クラス
-
ARGF
. class (2) - Array (53)
- BasicObject (2)
- BasicSocket (1)
- BigDecimal (7)
- Binding (1)
- CSV (6)
-
CSV
:: Row (7) -
CSV
:: Table (5) - Class (3)
- Complex (12)
-
DRb
:: DRbUnknown (1) - Dir (2)
- ERB (4)
- Encoding (2)
-
Encoding
:: Converter (11) -
Encoding
:: InvalidByteSequenceError (2) -
Encoding
:: UndefinedConversionError (1) - Enumerator (16)
-
Enumerator
:: Lazy (35) -
Enumerator
:: Yielder (3) - Exception (2)
- Fiber (1)
-
Fiddle
:: Function (1) -
Fiddle
:: Pointer (1) - File (2)
-
File
:: Stat (4) - Float (7)
-
Gem
:: Commands :: UpdateCommand (1) -
Gem
:: Requirement (11) -
Gem
:: Specification (10) -
Gem
:: Version (2) - Hash (50)
- IO (17)
-
IRB
:: Context (2) -
IRB
:: ExtendCommand :: Help (1) -
IRB
:: ExtendCommand :: Load (1) -
IRB
:: ExtendCommand :: Require (1) -
IRB
:: ExtendCommand :: Source (1) - Integer (20)
-
JSON
:: Parser (1) -
JSON
:: State (3) - Logger (17)
- MatchData (3)
- Matrix (27)
-
Matrix
:: LUPDecomposition (1) - Method (7)
- Module (85)
- Monitor (1)
-
Net
:: HTTP (8) -
Net
:: HTTPGenericRequest (8) -
Net
:: HTTPResponse (1) - Numeric (49)
- Object (24)
-
ObjectSpace
:: WeakMap (1) -
OpenSSL
:: ASN1 :: ASN1Data (2) -
OpenSSL
:: BN (6) - OpenStruct (2)
- OptionParser (19)
- Pathname (15)
- Prime (3)
-
Prime
:: EratosthenesGenerator (1) -
Prime
:: PseudoPrimeGenerator (4) - Proc (4)
-
Psych
:: Nodes :: Node (2) -
Psych
:: Stream (2) -
Psych
:: Visitors :: YAMLTree (2) -
RDoc
:: Parser :: Ruby (1) -
REXML
:: Attribute (3) -
REXML
:: Attributes (13) -
REXML
:: CData (1) -
REXML
:: Child (1) -
REXML
:: DocType (4) -
REXML
:: Document (3) -
REXML
:: Element (9) -
REXML
:: Instruction (2) -
REXML
:: Text (2) -
Rake
:: Application (2) -
Rake
:: DefaultLoader (1) -
Rake
:: FileList (5) -
Rake
:: TaskArguments (5) -
Rake
:: TestTask (2) - Random (1)
- Range (9)
- Rational (5)
- Refinement (1)
- Regexp (5)
-
Resolv
:: DNS (1) -
Resolv
:: DNS :: Name (1) -
RubyVM
:: AbstractSyntaxTree :: Node (7) -
RubyVM
:: InstructionSequence (11) - Set (17)
- String (68)
- StringIO (6)
- StringScanner (11)
- Struct (27)
- Symbol (3)
- Thread (6)
-
Thread
:: Backtrace :: Location (1) -
Thread
:: Mutex (5) -
Thread
:: Queue (9) -
Thread
:: SizedQueue (6) - ThreadGroup (2)
- Time (16)
- TracePoint (3)
- TrueClass (5)
-
URI
:: MailTo (3) - UnboundMethod (14)
- UncaughtThrowError (3)
- Vector (9)
-
WEBrick
:: HTTPRequest (1) - WIN32OLE (1)
-
WIN32OLE
_ TYPE (1) -
WIN32OLE
_ VARIANT (1) - XMP (1)
モジュール
- Enumerable (126)
-
Fiddle
:: Importer (3) - FileUtils (1)
- GC (1)
-
JSON
:: Generator :: GeneratorMethods :: String (1) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (1) - Kernel (5)
-
Net
:: HTTPHeader (6) -
OpenURI
:: Meta (8) -
OptionParser
:: Arguable (7) -
Rake
:: Cloneable (1) -
Rake
:: TaskManager (3) - TSort (3)
キーワード
- % (5)
- & (2)
- * (1)
- ** (1)
- + (3)
- +@ (1)
- - (2)
-
/ (1) - < (1)
- << (1)
- <= (1)
- <=> (2)
- == (3)
- === (2)
- =~ (1)
- > (1)
- >= (1)
- [] (5)
- []= (9)
- ^ (2)
-
_ dump (2) - abs (2)
- abs2 (2)
- absolute? (1)
-
absolute
_ path (2) - add (3)
-
add
_ attribute (2) -
add
_ attributes (1) -
add
_ dependency (1) -
add
_ development _ dependency (1) -
add
_ namespace (2) -
add
_ runtime _ dependency (1) -
add
_ trace _ func (1) - adjugate (1)
-
alias
_ method (1) - all? (3)
- ancestors (1)
- angle (1)
- any? (3)
-
append
_ features (1) - arg (1)
-
arg
_ config (1) - arity (2)
-
as
_ list (1) - ascend (1)
- attr (3)
-
attr
_ accessor (1) -
attr
_ reader (1) -
attr
_ writer (1) - attribute (1)
-
attribute
_ of (1) -
attributes
_ of (1) - autoclose? (1)
- autoload (1)
- autoload? (1)
-
base
_ label (1) -
base
_ uri (1) - basename (1)
-
basic
_ auth (1) - bind (2)
-
bind
_ call (2) - body (1)
- body= (1)
-
body
_ stream (1) -
body
_ stream= (1) - bsearch (2)
-
bsearch
_ index (1) - bump (1)
- byteslice (3)
- call (1)
- captures (1)
- casecmp (2)
- casecmp? (2)
- cause (1)
- ceil (1)
- chain (1)
- charset (2)
-
check
_ circular? (1) -
check
_ until (1) - children (2)
- chown (2)
- chunk (3)
-
chunk
_ while (1) - chunked? (1)
-
class
_ eval (2) -
class
_ exec (1) -
class
_ variable _ defined? (1) -
class
_ variable _ get (1) -
class
_ variable _ set (1) -
class
_ variables (1) - clear (1)
-
clear
_ exclude (1) - clone (1)
- close (1)
- closed? (1)
- coerce (1)
-
cofactor
_ expansion (1) - collect (6)
- collect! (3)
- collect2 (1)
-
collect
_ concat (3) - column (2)
-
column
_ vectors (1) - combination (1)
- compact (1)
- concat (2)
- configure (1)
- conj (1)
- conjugate (3)
-
const
_ defined? (1) -
const
_ get (1) -
const
_ missing (1) -
const
_ set (1) -
const
_ source _ location (1) - constants (1)
- content (1)
-
content
_ encoding (1) -
content
_ type (1) - convert (1)
- count (7)
-
create
_ makefile (1) -
create
_ rule (1) -
current
_ scope (1) - curry (4)
- cycle (3)
- debug (2)
- debug? (1)
- deconstruct (1)
-
deconstruct
_ keys (1) -
def
_ class (1) -
def
_ module (1) - default (2)
- default= (1)
-
default
_ argv (1) -
default
_ argv= (1) -
default
_ event _ sources (1) -
default
_ proc (1) -
default
_ proc= (1) -
define
_ method (2) -
defined
_ class (1) - delete (2)
-
delete
_ all (1) -
delete
_ attribute (1) -
delete
_ if (4) -
delete
_ suffix (1) -
delete
_ suffix! (1) -
deprecate
_ constant (1) - deq (2)
- descend (1)
- det (1)
- detect (2)
- determinant (1)
- difference (1)
- dig (1)
- disasm (1)
- disassemble (1)
- display (1)
- div (1)
- divmod (2)
-
do
_ not _ reverse _ lookup (1) -
do
_ rubygems _ update (1) - downto (1)
- drop (2)
-
drop
_ while (4) - dummy? (1)
- dump (1)
- dup (6)
- each (20)
-
each
_ attribute (1) -
each
_ byte (3) -
each
_ char (2) -
each
_ child (3) -
each
_ codepoint (3) -
each
_ cons (2) -
each
_ element _ with _ attribute (1) -
each
_ entry (2) -
each
_ grapheme _ cluster (2) -
each
_ index (1) -
each
_ key (1) -
each
_ line (6) -
each
_ pair (4) -
each
_ slice (2) -
each
_ strongly _ connected _ component (1) -
each
_ strongly _ connected _ component _ from (1) -
each
_ value (3) -
each
_ with _ index (5) -
each
_ with _ object (2) - eager (1)
- egrep (1)
- eigen (1)
- eigensystem (1)
- empty? (1)
- encode (3)
- encoding (1)
-
end
_ with? (1) - entries (1)
-
entrywise
_ product (1) -
enum
_ for (4) - eql? (4)
- equal? (3)
- error (2)
-
error
_ bytes (1) -
error
_ char (1) - eval (1)
- exact? (1)
-
exclude
_ end? (1) -
excluded
_ from _ list? (1) - executable? (1)
-
executable
_ real? (1) - execute (4)
- extend (1)
-
extend
_ object (1) - extended (1)
- fatal (2)
- fdiv (1)
- feed (1)
- fetch (3)
-
fetch
_ values (2) - field (1)
- filter (8)
- filter! (3)
-
filter
_ map (3) - find (2)
-
find
_ all (3) -
find
_ index (6) - finish (1)
- finite? (1)
- first (2)
-
first
_ column (1) -
first
_ lineno (2) -
fixed
_ encoding? (1) -
flat
_ map (3) - floor (1)
- flush (1)
- force (1)
-
force
_ encoding (1) -
force
_ quotes? (1) - freeze (1)
-
garbage
_ collect (1) - gem (1)
-
get
_ attribute (1) -
get
_ attribute _ ns (1) -
get
_ byte (1) - getbyte (1)
- getch (1)
- getlocal (1)
- getopts (1)
- getutc (1)
-
grapheme
_ clusters (2) - grep (3)
-
grep
_ v (3) -
group
_ by (2) - gsub (4)
- gsub! (5)
-
hadamard
_ product (1) -
has
_ value? (1) - hash (2)
- headers (2)
- hour (1)
- i (1)
- imag (2)
- imaginary (2)
-
import
_ methods (1) - include (1)
- include? (8)
- included (1)
-
included
_ modules (1) -
incomplete
_ input? (1) - index (4)
- infinite? (1)
- info (2)
- inherited (1)
- inject (3)
-
insert
_ output (1) - inspect (6)
-
instance
_ method (1) -
instance
_ methods (1) -
instance
_ variable _ set (1) -
instruction
_ sequence (1) - integer? (2)
- intersection (1)
- iseuc (1)
-
keep
_ if (3) - label (1)
-
laplace
_ expansion (1) -
last
_ column (1) -
last
_ lineno (1) -
last
_ modified (1) - lazy (2)
- length (4)
- list (1)
- ljust (1)
- load (1)
- localtime (1)
- locked? (1)
- log (2)
- lookup (1)
- lup (1)
-
lup
_ decomposition (1) - magnitude (6)
- map (6)
- map! (3)
-
marshal
_ dump (3) - match? (1)
-
matched
_ size (1) - max (5)
- max= (1)
-
max
_ by (4) - member? (2)
- members (1)
- merge (2)
- method (1)
-
method
_ added (1) -
method
_ defined? (1) -
method
_ removed (1) -
method
_ undefined (1) - methods (1)
- min (4)
-
min
_ by (4) - minmax (2)
-
minmax
_ by (2) -
mod
_ mul (1) -
mod
_ sub (1) -
module
_ eval (2) -
module
_ exec (1) -
module
_ function (3) - modulo (4)
- mountpoint? (1)
- name (2)
-
named
_ captures (2) - names (1)
- namespace (1)
- namespaces (1)
- negative? (1)
-
new
_ scope (1) - next (1)
-
next
_ values (1) - none? (4)
- nonzero? (1)
- norm (1)
-
num
_ bits (1) -
num
_ bytes (1) -
num
_ waiting (1) - numerator (4)
-
ole
_ query _ interface (1) -
on
_ head (1) -
on
_ tail (1) - one? (3)
- order! (4)
-
original
_ name (1) - owned? (1)
- owner (2)
- pack (2)
- parse (2)
- parse! (2)
- partition (2)
- path (2)
- peek (1)
-
peek
_ values (1) - permutation (2)
- permute (2)
- permute! (2)
- phase (1)
- polar (2)
- pop (2)
- positive? (1)
- pow (2)
- pread (1)
- prefix (1)
- prefixes (1)
- prepend (2)
-
prepend
_ features (1) - prepended (1)
- prerelease? (1)
-
pretty
_ print (1) -
previous
_ sibling= (1) -
prime
_ division (1) -
prime
_ fasttest? (1) -
primitive
_ convert (4) - private (4)
-
private
_ class _ method (2) -
private
_ constant (1) -
private
_ instance _ methods (1) -
private
_ method _ defined? (1) - product (2)
-
proper
_ subset? (1) -
proper
_ superset? (1) -
protected
_ method _ defined? (1) -
proxy
_ basic _ auth (1) - public (5)
-
public
_ class _ method (2) -
public
_ constant (1) -
public
_ instance _ method (1) -
public
_ method (1) -
public
_ method _ defined? (1) -
public
_ send (2) - push (3)
- putback (2)
- putc (1)
- puts (3)
- pwrite (1)
- query (1)
- quo (3)
-
quote
_ char (1) - r (1)
- rassoc (1)
- real (2)
- real? (1)
- rect (2)
- rectangular (3)
- reduce (3)
- refine (1)
- regular? (1)
- reject (6)
- reject! (3)
- reload (1)
- remainder (2)
-
remove
_ class _ variable (1) -
remove
_ const (1) -
remove
_ method (1) -
repeated
_ combination (1) -
repeated
_ permutation (2) - replace (1)
- replacement= (1)
- replicate (1)
-
request
_ body _ permitted? (1) -
request
_ get (2) -
request
_ head (2) -
request
_ post (2) - require (1)
-
required
_ ruby _ version (1) -
required
_ ruby _ version= (1) -
required
_ rubygems _ version (1) -
required
_ rubygems _ version= (1) -
respond
_ to? (1) -
respond
_ to _ missing? (1) -
response
_ body _ permitted? (1) - result (1)
- resume (1)
-
return
_ headers? (1) -
return
_ value (1) -
reverse
_ each (3) - rewind (1)
- rindex (1)
- rjust (1)
-
root
_ node (1) - round (9)
- ruby (1)
-
ruby2
_ keywords (2) -
ruby
_ opts (1) -
ruby
_ opts= (1) -
rubygems
_ version (1) -
rubygems
_ version= (1) - run (2)
-
satisfied
_ by? (1) - saturday? (1)
- scan (1)
-
scan
_ full (1) -
scan
_ until (1) - scrub (3)
- scrub! (3)
-
search
_ full (1) - select (8)
- select! (3)
-
send
_ request (1) -
set
_ debug _ output (1) -
set
_ encoding _ by _ bom (1) -
set
_ trace _ func (1) - setuid? (1)
- shift (2)
- shuffle (2)
- shuffle! (2)
-
singleton
_ class? (1) -
singleton
_ method _ undefined (1) -
singleton
_ methods (1) - size (5)
-
skip
_ until (1) - sleep (1)
- slice (1)
- slice! (1)
-
slice
_ after (4) -
slice
_ before (5) -
slice
_ when (2) - solve (1)
- sort (2)
-
sort
_ by (2) -
sort
_ by! (1) - source (2)
-
source
_ encoding (1) -
source
_ location (4) - specific? (1)
- squeeze (1)
- squeeze! (1)
-
stand
_ alone? (1) - start (3)
- status (1)
- step (11)
- store (1)
- strftime (1)
- struct (1)
- sub (5)
- sub! (4)
-
sub
_ ext (1) -
sub
_ type (1) - subclasses (1)
-
subdomain
_ of? (1) - subsec (1)
- subset? (1)
- subtract (1)
- succ (3)
- succ! (1)
- sum (5)
- summarize (2)
-
summary
_ indent (1) -
summary
_ indent= (1) -
summary
_ width (1) -
summary
_ width= (1) - sunday? (1)
-
super
_ method (1) - superclass (1)
- superset? (1)
- synchronize (1)
- tag (1)
- take (2)
-
take
_ while (5) - tally (2)
- target (1)
- then (1)
-
thread
_ variable _ set (1) - thursday? (1)
- timeouts= (1)
- times (1)
-
to
_ a (5) -
to
_ binary (1) -
to
_ c (1) -
to
_ enum (4) -
to
_ h (7) -
to
_ hash (1) -
to
_ int (1) -
to
_ json (3) -
to
_ mailtext (1) -
to
_ proc (1) -
to
_ rfc822text (1) -
to
_ ruby (2) -
to
_ s (6) -
to
_ set (2) -
to
_ string (1) -
to
_ value (1) - touch (1)
- transform (1)
-
transform
_ keys (1) -
transform
_ keys! (1) -
transform
_ values (2) -
transform
_ values! (2) - truncate (8)
- trust (1)
-
try
_ lock (1) -
tsort
_ each (1) -
tty
_ output= (1) - tuesday? (1)
-
tv
_ usec (1) - type (1)
- ucmp (1)
- uid (1)
- unbind (1)
-
unconverted
_ fields? (1) -
undef
_ method (1) - undump (1)
- ungetc (1)
-
unicode
_ normalize (1) -
unicode
_ normalize! (1) -
unicode
_ normalized? (1) - union (3)
- uniq (4)
- uniq! (2)
- unknown (2)
- unlink (1)
- unpack (1)
- unpack1 (1)
- unscan (1)
- unshift (1)
- untaint (1)
- untrust (1)
- untrusted? (1)
- upcase (1)
- upcase! (1)
- update (2)
- upto (3)
-
use
_ readline (1) -
use
_ readline? (1) - usec (1)
- using (1)
- utc (1)
- utc? (1)
-
utc
_ offset (1) - value (6)
- value= (2)
- value? (1)
- values (2)
-
values
_ at (5) - version (1)
- wait (1)
-
wait
_ for _ cond (1) -
wait
_ readable (1) - wakeup (1)
- warn (2)
-
with
_ defaults (1) -
with
_ index (6) -
with
_ object (2) - write (1)
- yield (1)
-
yield
_ self (1) - zero? (1)
- zip (4)
- | (2)
検索結果
先頭5件
-
RubyVM
:: AbstractSyntaxTree :: Node # first _ column -> Integer (87322.0) -
ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
ソースコード中で、self を表すテキストが最初に現れる列番号を返します。
列番号は0-originで、バイト単位で表されます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_column # => 0
//} -
RubyVM
:: AbstractSyntaxTree :: Node # last _ column -> Integer (87322.0) -
ソースコード中で、self を表すテキストが最後に現れる列番号を返します。
ソースコード中で、self を表すテキストが最後に現れる列番号を返します。
列番号は0-originで、バイト単位で表されます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_column # => 5
//} -
RubyVM
:: InstructionSequence # absolute _ path -> String | nil (87304.0) -
self が表す命令シーケンスの絶対パスを返します。
self が表す命令シーケンスの絶対パスを返します。
self を文字列から作成していた場合は nil を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.absolute_path
# => nil
例2: RubyVM::InstructionSequence.compile_file を使用した場合
# /tmp/method.... -
RubyVM
:: InstructionSequence # to _ a -> Array (78040.0) -
self の情報を 14 要素の配列にして返します。
self の情報を 14 要素の配列にして返します。
命令シーケンスを以下の情報で表します。
: magic
データフォーマットを示す文字列。常に
"YARVInstructionSequence/SimpleDataFormat"。
: major_version
命令シーケンスのメジャーバージョン。
: minor_version
命令シーケンスのマイナーバージョン。
: format_type
データフォーマットを示す数値。常に 1。
: misc
以下の要素から構成される Hash オブジェクト。
:arg_size: メソッド、ブ... -
RubyVM
:: InstructionSequence # to _ binary(extra _ data = nil) -> String (78040.0) -
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。 RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
バイナリフォーマットでシリアライズされたiseqのデータを文字列として返します。
RubyVM::InstructionSequence.load_from_binary メソッドでバイナリデータに対応するiseqオブジェクトを作れます。
引数の extra_data はバイナリデータと共に保存されます。
RubyVM::InstructionSequence.load_from_binary_extra_data メソッドでこの文字列にアクセス出来ます。
注意: 変換後のバイナリデータはポータブルではありません。 to_binary で得たバイナリデータは他のマシンに移動できません。他... -
RubyVM
:: AbstractSyntaxTree :: Node # children -> Array (78022.0) -
self の子ノードを配列で返します。
self の子ノードを配列で返します。
どのような子ノードが返ってくるかは、そのノードの type によって異なります。
戻り値は、ほかの RubyVM::AbstractSyntaxTree::Node のインスタンスや nil を含みます。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.children
# => [[], nil, #<RubyVM::AbstractSyntaxTree::Node:OPCALL@1:0-1:5>]
//} -
RubyVM
:: AbstractSyntaxTree :: Node # first _ lineno -> Integer (78022.0) -
ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
ソースコード中で、self を表すテキストが最初に現れる行番号を返します。
行番号は1-originです。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 2')
p node.first_lineno # => 1
//} -
RubyVM
:: AbstractSyntaxTree :: Node # inspect -> String (78022.0) -
self のデバッグ用の情報を含んだ文字列を返します。
self のデバッグ用の情報を含んだ文字列を返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
puts node.inspect
# => #<RubyVM::AbstractSyntaxTree::Node:SCOPE@1:0-1:5>
//} -
RubyVM
:: AbstractSyntaxTree :: Node # last _ lineno -> Integer (78022.0) -
ソースコード中で、self を表すテキストが最後に現れる行番号を返します。
ソースコード中で、self を表すテキストが最後に現れる行番号を返します。
行番号は1-originです。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.last_lineno # => 1
//} -
RubyVM
:: AbstractSyntaxTree :: Node # type -> Symbol (78022.0) -
self の種類を Symbol で返します。
self の種類を Symbol で返します。
//emlist[][ruby]{
node = RubyVM::AbstractSyntaxTree.parse('1 + 1')
p node.type # => :SCOPE
//} -
RubyVM
:: InstructionSequence # inspect -> String (78022.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path -
RubyVM
:: InstructionSequence # base _ label -> String (78004.0) -
self が表す命令シーケンスの基本ラベルを返します。
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
puts "h... -
RubyVM
:: InstructionSequence # disasm -> String (78004.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobje... -
RubyVM
:: InstructionSequence # disassemble -> String (78004.0) -
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
self が表す命令シーケンスを人間が読める形式の文字列に変換して返します。
puts RubyVM::InstructionSequence.compile('1 + 2').disasm
出力:
== disasm: <RubyVM::InstructionSequence:<compiled>@<compiled>>==========
0000 trace 1 ( 1)
0002 putobject 1
0004 putobje... -
RubyVM
:: InstructionSequence # eval -> object (78004.0) -
self の命令シーケンスを評価してその結果を返します。
self の命令シーケンスを評価してその結果を返します。
RubyVM::InstructionSequence.compile("1 + 2").eval # => 3 -
RubyVM
:: InstructionSequence # first _ lineno -> Integer (78004.0) -
self が表す命令シーケンスの 1 行目の行番号を返します。
self が表す命令シーケンスの 1 行目の行番号を返します。
例1:irb で実行した場合
RubyVM::InstructionSequence.compile('num = 1 + 2').first_lineno
# => 1
例2:
# /tmp/method.rb
require "foo-library"
def foo
p :foo
end
RubyVM::InstructionSequence.of(method(:foo)).first_lineno
# => 2 -
RubyVM
:: InstructionSequence # label -> String (78004.0) -
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、 モジュール名などで構成されます。
self が表す命令シーケンスのラベルを返します。通常、メソッド名、クラス名、
モジュール名などで構成されます。
トップレベルでは "<main>" を返します。self を文字列から作成していた場合
は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.label
# => "<compiled>"
例2: R... -
RubyVM
:: InstructionSequence # path -> String (78004.0) -
self が表す命令シーケンスの相対パスを返します。
self が表す命令シーケンスの相対パスを返します。
self の作成時に指定した文字列を返します。self を文字列から作成していた
場合は "<compiled>" を返します。
例1:irb で実行した場合
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
# => <RubyVM::InstructionSequence:<compiled>@<compiled>>
iseq.path
# => "<compiled>"
例2: RubyVM::InstructionSequence.compi... -
Gem
:: Commands :: UpdateCommand # do _ rubygems _ update(version) (45604.0) -
RubyGems 自体を更新します。
RubyGems 自体を更新します。 -
Rake
:: Application # tty _ output=(tty _ output _ state) (37222.0) -
TTY に対する出力状態を上書きします。
TTY に対する出力状態を上書きします。
大抵の場合、テストのために使用します。
@param tty_output_state 変更後の状態を指定します
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
Rake.application.tty_output? # => false
Rake.application.tty_output = "debug output" # => "debug output"
... -
Gem
:: Specification # required _ ruby _ version -> Gem :: Requirement (36955.0) -
この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。
この Gem パッケージを動作させるのに必要な Ruby のバージョンを返します。 -
Gem
:: Specification # required _ ruby _ version=(requirement) (36955.0) -
この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。
この Gem パッケージを動作させるのに必要な Ruby のバージョンをセットします。
@param requirement Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。
@see Gem::Requirement -
Gem
:: Specification # required _ rubygems _ version -> Gem :: Requirement (36904.0) -
この Gem パッケージを動作させるのに必要な RubyGems のバージョンを返します。
この Gem パッケージを動作させるのに必要な RubyGems のバージョンを返します。 -
Gem
:: Specification # required _ rubygems _ version=(requirement) (36904.0) -
この Gem パッケージを動作させるのに必要な RubyGems のバージョンをセットします。
この Gem パッケージを動作させるのに必要な RubyGems のバージョンをセットします。
@param requirement Gem::Requirement.create が受け付ける形式のオブジェクトを指定します。
@see Gem::Requirement -
Module
# ruby2 _ keywords(method _ name , . . . ) -> nil (36697.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... -
Proc
# ruby2 _ keywords -> proc (36697.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 ... -
FileUtils
# ruby(*args) {|result , status| . . . } (36691.0) -
与えられた引数で Ruby インタプリタを実行します。
与えられた引数で Ruby インタプリタを実行します。
@param args Ruby インタプリタに与える引数を指定します。
例:
ruby %{-pe '$_.upcase!' <README}
@see Kernel.#sh -
Encoding
:: Converter # insert _ output(string) -> nil (36676.0) -
変換器内のバッファに文字列を挿入します。 バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換器内のバッファに文字列を挿入します。
バッファに保持された文字列は、次の変換時の変換結果と一緒に返されます。
変換先がステートフルなエンコーディングであった場合、
挿入された文字列は状態に基づいて変換され、状態を更新します。
このメソッドは変換に際してエラーが発生した際にのみ利用されるべきです。
@param string 挿入する文字列
//emlist[][ruby]{
ec = Encoding::Converter.new("utf-8", "iso-8859-1")
src = "HIRAGANA LETTER A is \u{3042}."
dst = ""
p ec.... -
Gem
:: Specification # to _ ruby -> String (36655.0) -
自身を再現するための Ruby スクリプトを文字列で返します。
自身を再現するための Ruby スクリプトを文字列で返します。
省略されている値はデフォルト値が使用されます。 -
Psych
:: Nodes :: Node # to _ ruby -> object (36655.0) -
AST を ruby のオブジェクトに変換します。
AST を ruby のオブジェクトに変換します。 -
Rake
:: TestTask # ruby _ opts -> Array (36655.0) -
テスト実行時に Ruby コマンドに渡されるオプションを返します。
テスト実行時に Ruby コマンドに渡されるオプションを返します。 -
Rake
:: TestTask # ruby _ opts=(options) (36655.0) -
テスト実行時に Ruby コマンドに渡されるオプションをセットします。
テスト実行時に Ruby コマンドに渡されるオプションをセットします。
@param options 配列でオプションを指定します。 -
Gem
:: Specification # rubygems _ version -> String (36604.0) -
この Gem パッケージを作成した RubyGems のバージョンを返します。
この Gem パッケージを作成した RubyGems のバージョンを返します。 -
Gem
:: Specification # rubygems _ version=(version) (36604.0) -
この Gem パッケージを作成した RubyGems のバージョンをセットします。 この属性は Gem パッケージが作成された時に自動的にセットされます。
この Gem パッケージを作成した RubyGems のバージョンをセットします。
この属性は Gem パッケージが作成された時に自動的にセットされます。
@param version RubyGems のバージョンを指定します。 -
OpenURI
:: Meta # base _ uri -> URI (27658.0) -
リソースの実際の URI を URI オブジェクトとして返します。 リダイレクトされた場合は、リダイレクトされた後のデータが存在する URI を返します。
リソースの実際の URI を URI オブジェクトとして返します。
リダイレクトされた場合は、リダイレクトされた後のデータが存在する URI を返します。
//emlist[例][ruby]{
require 'open-uri'
URI.open('http://www.ruby-lang.org/') {|f|
p f.base_uri
#=> #<URI::HTTP:0xb7043aa0 URL:http://www.ruby-lang.org/en/>
}
//} -
Enumerator
:: Lazy # enum _ for(method = :each , *args) -> Enumerator :: Lazy (27622.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # enum _ for(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (27622.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) -> Enumerator :: Lazy (27622.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
Enumerator
:: Lazy # to _ enum(method = :each , *args) {|*args| block} -> Enumerator :: Lazy (27622.0) -
Object#to_enum と同じですが、Enumerator::Lazy を返します。
Object#to_enum と同じですが、Enumerator::Lazy を返します。
to_enum は「ブロック付きで呼ぶとループを実行し、ブロックを省略した場合は
Enumerator を返す」ようなメソッドを定義するときによく使われます。
このときに lazy 性が正しく引き継がれるように、Lazy#to_enum は
素のEnumerator ではなく Enumerator::Lazy を返すようになっています。
//emlist[例][ruby]{
module Enumerable
# 要素をn回ずつ繰り返すメソッド
# 例:[1,2,3].repeat(2) ... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (27622.0) -
各属性に対しブロックを呼び出します。
各属性に対しブロックを呼び出します。
個々の属性は REXML::Attribute オブジェクトで渡されます。
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='<'/>
</root>
EOS
a = doc.get_elements("/root... -
REXML
:: Attributes # get _ attribute(name) -> Attribute | nil (27622.0) -
name という名前の属性を取得します。
name という名前の属性を取得します。
name という名前を持つ属性がない場合は nil を返します。
@param name 属性名(文字列)
@see REXML::Attributes#[]
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='... -
REXML
:: Attributes # get _ attribute _ ns(namespace , name) -> REXML :: Attribute | nil (27622.0) -
namespace と name で特定される属性を返します。
namespace と name で特定される属性を返します。
namespace で名前空間を、 name で prefix を含まない属性名を
指定します。
指定された属性が存在しない場合は nil を返します。
XML プロセッサが prefix を置き換えてしまった場合でも、このメソッドを
使うことで属性を正しく指定することができます。
@param namespace 名前空間(URI, 文字列)
@param name 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.ne... -
UnboundMethod
# source _ location -> [String , Integer] | nil (27358.0) -
ソースコードのファイル名と行番号を配列で返します。
ソースコードのファイル名と行番号を配列で返します。
その手続オブジェクトが ruby で定義されていない(つまりネイティブ
である)場合は nil を返します。
//emlist[例][ruby]{
require 'time'
Time.instance_method(:zone).source_location # => nil
Time.instance_method(:httpdate).source_location # => ["/Users/user/.rbenv/versions/2.4.3/lib/ruby/2.4.0/time.rb", 654]
/... -
Enumerable
# sum(init=0) -> object (27340.0) -
要素の合計を返します。
要素の合計を返します。
ブロックが与えられた場合、加算する前に各要素にブロックが適用されます。
selfが空の場合、initを返します。
//emlist[例][ruby]{
{ 1 => 10, 2 => 20 }.sum {|k, v| k * v } # => 50
(1..10).sum # => 55
(1..10).sum {|v| v * 2 } # => 110
('a'..'z').sum # => TypeError
... -
Enumerable
# sum(init=0) {|e| expr } -> object (27340.0) -
要素の合計を返します。
要素の合計を返します。
ブロックが与えられた場合、加算する前に各要素にブロックが適用されます。
selfが空の場合、initを返します。
//emlist[例][ruby]{
{ 1 => 10, 2 => 20 }.sum {|k, v| k * v } # => 50
(1..10).sum # => 55
(1..10).sum {|v| v * 2 } # => 110
('a'..'z').sum # => TypeError
... -
Module
# module _ function() -> nil (27340.0) -
メソッドをモジュール関数にします。
メソッドをモジュール関数にします。
引数が与えられた時には、
引数で指定されたメソッドをモジュール関数にします。
引数なしのときは今後このモジュール定義文内で
新しく定義されるメソッドをすべてモジュール関数にします。
モジュール関数とは、プライベートメソッドであると同時に
モジュールの特異メソッドでもあるようなメソッドです。
例えば Math モジュールのメソッドはすべてモジュール関数です。
単一の引数が与えられた時には与えられた引数をそのまま返します。
複数の引数が与えられた時には配列にまとめて返します。
引数なしの時は nil を返します。
@param name String ... -
Module
# module _ function(*name) -> Array (27340.0) -
メソッドをモジュール関数にします。
メソッドをモジュール関数にします。
引数が与えられた時には、
引数で指定されたメソッドをモジュール関数にします。
引数なしのときは今後このモジュール定義文内で
新しく定義されるメソッドをすべてモジュール関数にします。
モジュール関数とは、プライベートメソッドであると同時に
モジュールの特異メソッドでもあるようなメソッドです。
例えば Math モジュールのメソッドはすべてモジュール関数です。
単一の引数が与えられた時には与えられた引数をそのまま返します。
複数の引数が与えられた時には配列にまとめて返します。
引数なしの時は nil を返します。
@param name String ... -
Module
# module _ function(name) -> String | Symbol (27340.0) -
メソッドをモジュール関数にします。
メソッドをモジュール関数にします。
引数が与えられた時には、
引数で指定されたメソッドをモジュール関数にします。
引数なしのときは今後このモジュール定義文内で
新しく定義されるメソッドをすべてモジュール関数にします。
モジュール関数とは、プライベートメソッドであると同時に
モジュールの特異メソッドでもあるようなメソッドです。
例えば Math モジュールのメソッドはすべてモジュール関数です。
単一の引数が与えられた時には与えられた引数をそのまま返します。
複数の引数が与えられた時には配列にまとめて返します。
引数なしの時は nil を返します。
@param name String ... -
Module
# included _ modules -> [Module] (27322.0) -
self にインクルードされているモジュールの配列を返します。
self にインクルードされているモジュールの配列を返します。
//emlist[例][ruby]{
module Mixin
end
module Outer
include Mixin
end
Mixin.included_modules #=> []
Outer.included_modules #=> [Mixin]
//}
@see Module#ancestors -
Net
:: HTTPGenericRequest # request _ body _ permitted? -> bool (27322.0) -
リクエストにエンティティボディを一緒に送ることが許されている HTTP メソッド (POST など)の場合真を返します。
リクエストにエンティティボディを一緒に送ることが許されている
HTTP メソッド (POST など)の場合真を返します。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
post = Net::HTTP::Post.new(uri.request_uri)
post.request_body_permitted? # => true
head = Net::HTTP::Head.new(uri.request_uri)
head.request_bo... -
Struct
# deconstruct -> [object] (27322.0) -
構造体のメンバの値を配列にいれて返します。
構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してくだ... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (27322.0) -
self のメンバの名前と値の組を Hash で返します。
self のメンバの名前と値の組を Hash で返します。
@param array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_keys([:zip, :address])
h # => {:zip=>12345, :address... -
Struct
# values -> [object] (27322.0) -
構造体のメンバの値を配列にいれて返します。
構造体のメンバの値を配列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してくだ... -
Thread
:: Queue # num _ waiting -> Integer (27322.0) -
キューを待っているスレッドの数を返します。
キューを待っているスレッドの数を返します。
//emlist[例][ruby]{
require 'thread'
q = SizedQueue.new(1)
q.push(1)
t = Thread.new { q.push(2) }
sleep 0.05 until t.stop?
q.num_waiting # => 1
q.pop
t.join
//} -
WEBrick
:: HTTPRequest # query -> Hash (27322.0) -
リクエストのクエリーあるいはクライアントがフォームへ入力した値を表すハッシュを返します。
リクエストのクエリーあるいはクライアントがフォームへ入力した値を表すハッシュを返します。
ハッシュのキーも値も unescape されています。ただし multipart/form-data なフォームデータの場合には
ユーザが content-transfer-encoding ヘッダを見て適切に処理する必要があります。
ハッシュの値は正確には文字列ではなく String クラスのサブクラスである WEBrick::HTTPUtils::FormData
クラスのインスタンスです。
multipart/form-data なフォームデータであってもサイズの制限なく、通常のフォームデー... -
String
# unpack(template) -> Array (20662.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
Array#pack で生成された文字列を
テンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」
を表すこともできます。
長さの意味はテンプレート文字により異なりますが大... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) -> () (18976.0) -
サマリを指定された to へと加えていきます。
サマリを指定された to へと加えていきます。
ブロックが与えられた場合、サマリの各行を引数としてブロックを評価します。
この場合、ブロックの中で明示的に to へと加えていかない限り、
to にサマリが加えられることはありません。
@param to サマリを出力するオブジェクトを指定します。to には << メソッドが定義されいる必要があります。
@param width サマリの幅を整数で指定します。
@param max サマリの最大幅を整数で指定します。
@param indent サマリのインデントを文字列で指定します。
//emlist[例][ruby]{
requ... -
OptionParser
# summarize(to = [] , width = self . summary _ width , max = width - 1 , indent= self . summary _ indent) {|line| . . . } -> () (18976.0) -
サマリを指定された to へと加えていきます。
サマリを指定された to へと加えていきます。
ブロックが与えられた場合、サマリの各行を引数としてブロックを評価します。
この場合、ブロックの中で明示的に to へと加えていかない限り、
to にサマリが加えられることはありません。
@param to サマリを出力するオブジェクトを指定します。to には << メソッドが定義されいる必要があります。
@param width サマリの幅を整数で指定します。
@param max サマリの最大幅を整数で指定します。
@param indent サマリのインデントを文字列で指定します。
//emlist[例][ruby]{
requ... -
Method
# unbind -> UnboundMethod (18922.0) -
self のレシーバとの関連を取り除いた UnboundMethod オブ ジェクトを生成して返します。
self のレシーバとの関連を取り除いた UnboundMethod オブ
ジェクトを生成して返します。
//emlist[例][ruby]{
class Foo
def foo
"foo"
end
end
m = Foo.new.method(:foo) # => #<Method: Foo#foo>
unbound_method = m.unbind # => #<UnboundMethod: Foo#foo>
unbound_method.bind(Foo.new) # => #<Method: Foo#foo>
//} -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (18922.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
script_compiledイベント発生時にコンパイルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}
@raise RuntimeError :script_comp... -
Matrix
# lup -> Matrix :: LUPDecomposition (18712.0) -
行列の LUP 分解を保持したオブジェクトを返します。
行列の LUP 分解を保持したオブジェクトを返します。
Matrix::LUPDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(下三角行列、上三角行列、置換行列)
を得ることができます。これを [L, U, P] と書くと、
L*U = P*self を満たします。
//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.... -
Matrix
# lup _ decomposition -> Matrix :: LUPDecomposition (18712.0) -
行列の LUP 分解を保持したオブジェクトを返します。
行列の LUP 分解を保持したオブジェクトを返します。
Matrix::LUPDecomposition は to_ary を定義しているため、
多重代入によって3つの行列(下三角行列、上三角行列、置換行列)
を得ることができます。これを [L, U, P] と書くと、
L*U = P*self を満たします。
//emlist[例][ruby]{
require 'matrix'
a = Matrix[[1, 2], [3, 4]]
l, u, p = a.lup
l.lower_triangular? # => true
u.upper_triangular? # => true
p.... -
String
# grapheme _ clusters {|grapheme _ cluster| block } -> self (18676.0) -
文字列の書記素クラスタの配列を返します。(self.each_grapheme_cluster.to_a と同じです)
文字列の書記素クラスタの配列を返します。(self.each_grapheme_cluster.to_a と同じです)
//emlist[例][ruby]{
"a\u0300".grapheme_clusters # => ["à"]
//}
ブロックが指定された場合は String#each_grapheme_cluster と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_grapheme_cluster -
ERB
# def _ module(methodname=& # 39;erb& # 39;) -> Module (18670.0) -
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
変換した Ruby スクリプトをメソッドとして定義した無名のモジュールを返します。
@param methodname メソッド名
//emlist[例][ruby]{
require 'erb'
filename = 'example.rhtml'
erb = ERB.new("test1<%= arg1 %>\ntest2<%= arg2 %>\n")
erb.filename = filename
MyModule = erb.def_module('render(arg1, arg2)')
class MyClass
include MyModule
end
print My... -
String
# each _ grapheme _ cluster {|grapheme _ cluster| block } -> self (18658.0) -
文字列の書記素クラスタに対して繰り返します。
文字列の書記素クラスタに対して繰り返します。
String#each_char と違って、
Unicode Standard Annex #29 (https://unicode.org/reports/tr29/)
で定義された書記素クラスタに対して繰り返します。
//emlist[例][ruby]{
"a\u0300".each_char.to_a.size # => 2
"a\u0300".each_grapheme_cluster.to_a.size # => 1
//}
@see String#grapheme_clusters -
OpenSSL
:: ASN1 :: ASN1Data # value=(value) (18652.0) -
ASN.1 値に対応するRubyのオブジェクトを変更します。
ASN.1 値に対応するRubyのオブジェクトを変更します。
@param value 設定するオブジェクト
@see OpenSSL::ASN1::ASN1Data#value -
Net
:: HTTPHeader # each _ value {|value| . . . . } -> () (18640.0) -
保持しているヘッダの値をブロックに渡し、呼びだします。
保持しているヘッダの値をブロックに渡し、呼びだします。
渡される文字列は ", " で連結したものです。
//emlist[例][ruby]{
require 'net/http'
uri = URI.parse('http://www.example.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.each_value { |value| puts value }
# => gzip;q=1.0,deflate;q=0.6,identity;q=0.3
# => */*
# => Ruby
//} -
Object
# enum _ for(method = :each , *args) -> Enumerator (18640.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# enum _ for(method = :each , *args) {|*args| . . . } -> Enumerator (18640.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) -> Enumerator (18640.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Object
# to _ enum(method = :each , *args) {|*args| . . . } -> Enumerator (18640.0) -
Enumerator.new(self, method, *args) を返します。
Enumerator.new(self, method, *args) を返します。
ブロックを指定した場合は Enumerator#size がブロックの評価結果を返
します。ブロックパラメータは引数 args です。
@param method メソッド名の文字列かシンボルです。
@param args 呼び出すメソッドに渡される引数です。
//emlist[][ruby]{
str = "xyz"
enum = str.enum_for(:each_byte)
p(a = enum.map{|b| '%02x' % b }) #=> ["78", "79", "7a"]
#... -
Hash
# each _ value {|value| . . . } -> self (18622.0) -
ハッシュの値を引数としてブロックを評価します。
ハッシュの値を引数としてブロックを評価します。
反復の際の評価順序はキーが追加された順です。
ブロック付きの場合selfを、
無しで呼ばれた場合 Enumerator を返します。
//emlist[例][ruby]{
{:a=>1, :b=>2}.each_value {|v| p v}
#=> 1
# 2
p({:a=>1, :b=>2}.each_value) # => #<Enumerator: {:a=>1, :b=>2}:each_value>
//}
@see Hash#each_pair,Hash#each_key -
Hash
# has _ value?(value) -> bool (18622.0) -
ハッシュが value を値として持つ時真を返します。 値の一致判定は == で行われます。
ハッシュが value を値として持つ時真を返します。
値の一致判定は == で行われます。
@param value 探索する値を指定します。
//emlist[][ruby]{
p({1 => "one"}.value?("one")) #=> true
p({1 => "one"}.value?("two")) #=> false
//}
@see Hash#key? -
Hash
# transform _ values {|value| . . . } -> Hash (18622.0) -
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。 キーは変化しません。
すべての値に対してブロックを呼び出した結果で置き換えたハッシュを返します。
キーは変化しません。
@return 置き換えたハッシュを返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values(&:to_s) #=> { a: "1", b: "2", ... -
Hash
# transform _ values! {|value| . . . } -> self (18622.0) -
すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。 キーは変化しません。
すべての値に対してブロックを呼び出した結果でハッシュの値を変更します。
キーは変化しません。
@return transform_values! は常に self を返します。
ブロックが与えられなかった場合は、Enumerator オブジェクトを
返します。
//emlist[例][ruby]{
h = { a: 1, b: 2, c: 3 }
h.transform_values! {|v| v * v + 1 } #=> { a: 2, b: 5, c: 10 }
h.transform_values!(&:to_s) #=> ... -
Hash
# value?(value) -> bool (18622.0) -
ハッシュが value を値として持つ時真を返します。 値の一致判定は == で行われます。
ハッシュが value を値として持つ時真を返します。
値の一致判定は == で行われます。
@param value 探索する値を指定します。
//emlist[][ruby]{
p({1 => "one"}.value?("one")) #=> true
p({1 => "one"}.value?("two")) #=> false
//}
@see Hash#key? -
REXML
:: DocType # attribute _ of(element , attribute) -> String | nil (18622.0) -
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という 名前の属性のデフォルト値を返します。
DTD 内の属性リスト宣言で、 element という名前の要素の attribute という
名前の属性のデフォルト値を返します。
elementという名前の要素の属性値は宣言されていない、
elementという名前の要素にはattributeという名前の属性が宣言されていない、
もしくはデフォルト値が宣言されていない、のいずれかの場合は nil を返します。
@param element 要素名(文字列)
@param attribute 属性名(文字列)
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Doc... -
REXML
:: DocType # attributes _ of(element) -> [REXML :: Attribute] (18622.0) -
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている 属性の名前とデフォルト値を REXML::Attribute の配列で返します。
DTD 内の属性リスト宣言で、 element という名前の要素に対し宣言されている
属性の名前とデフォルト値を REXML::Attribute の配列で返します。
名前とデフォルト値のペアは、各 Attribute オブジェクトの
REXML::Attribute#name と
REXML::Attribute#value で表現されます。
//emlist[][ruby]{
require 'rexml/document'
doctype = REXML::Document.new(<<EOS).doctype
<!DOCTYPE books [
<!ELEMENT book (c... -
REXML
:: Element # attribute(name , namespace = nil) -> REXML :: Attribute | nil (18622.0) -
name で指定される属性を返します。
name で指定される属性を返します。
属性は REXML::Attribute オブジェクトの形で返します。
name は "foo:bar" のように prefix を指定することができます。
namespace で名前空間の URI を指定することで、その名前空間内で
name という属性名を持つ属性を指定できます。
指定した属性名の属性がない場合は nil を返します。
@param name 属性名(文字列)
@param namespace 名前空間のURI(文字列)
//emlist[][ruby]{
require 'rexml/document'
doc = R... -
REXML
:: Element # delete _ attribute(key) -> REXML :: Attribute | nil (18622.0) -
要素から key という属性名の属性を削除します。
要素から key という属性名の属性を削除します。
削除された属性を返します。
key という属性名の属性が存在しない場合は削除されずに、nil を返します。
@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)
//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x... -
Rake
:: TaskArguments # with _ defaults(defaults) -> Hash (18622.0) -
パラメータにデフォルト値をセットします。
パラメータにデフォルト値をセットします。
@param defaults デフォルト値として使用するキーと値を格納したハッシュを指定します。
//emlist[][ruby]{
# Rakefile での記載例とする
task default: :test_rake_app
task :test_rake_app do
arguments = Rake::TaskArguments.new(["name1", "name2"], ["value1", "value2"])
arguments.to_hash ... -
String
# delete _ suffix!(suffix) -> self | nil (18622.0) -
self の末尾から破壊的に suffix を削除します。
self の末尾から破壊的に suffix を削除します。
@param suffix 末尾から削除する文字列を指定します。
@return 削除した場合は self、変化しなかった場合は nil
//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}
@see String#chomp!
@see String#chop!
@see String#delete_prefix!
@see String#delete_suffix
@see S... -
String
# delete _ suffix(suffix) -> String (18622.0) -
文字列の末尾から suffix を削除した文字列のコピーを返します。
文字列の末尾から suffix を削除した文字列のコピーを返します。
@param suffix 末尾から削除する文字列を指定します。
@return 文字列の末尾から suffix を削除した文字列のコピー
//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}
@see String#chomp
@see String#chop
@see String#delete_prefix
@see String#delete_suffix!
... -
UnboundMethod
# clone -> UnboundMethod (18622.0) -
自身を複製した UnboundMethod オブジェクトを作成して返します。
自身を複製した UnboundMethod オブジェクトを作成して返します。
//emlist[例][ruby]{
a = String.instance_method(:size)
b = a.clone
a == b # => true
//} -
Fiddle
:: Importer # union(signature) -> Class (18460.0) -
C の共用体型に対応する Ruby のクラスを構築して返します。
C の共用体型に対応する Ruby のクラスを構築して返します。
共用体型を Ruby 上で定義する方法は Fiddle::Importer#struct と
ほぼ同様です。C における
typedef union epoll_data
{
void *ptr;
int fd;
uint32_t u32;
uint64_t u64;
} epoll_data_t;
は、Ruby上では
require 'fiddle/import'
module M
extend Fiddle::Importer
dlload "lib... -
Enumerable
# chunk {|elt| . . . } -> Enumerator (18430.0) -
要素を前から順にブロックで評価し、その結果によって 要素をチャンクに分けた(グループ化した)要素を持つ Enumerator を返します。
要素を前から順にブロックで評価し、その結果によって
要素をチャンクに分けた(グループ化した)要素を持つ
Enumerator を返します。
ブロックの評価値が同じ値が続くものを一つのチャンクとして
取り扱います。すなわち、ブロックの評価値が一つ前と
異なる所でチャンクが区切られます。
返り値の Enumerator は各チャンクのブロック評価値と
各チャンクの要素を持つ配列のペアを各要素とします。
そのため、eachだと以下のようになります。
//emlist[][ruby]{
enum.chunk {|elt| key }.each {|key, ary| do_something ... -
String
# scrub -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# scrub {|bytes| . . . } -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# scrub! -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# scrub! {|bytes| . . . } -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# scrub!(repl) -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えます。常に self を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# scrub(repl) -> String (18430.0) -
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
self が不正なバイト列を含む場合に別の文字列に置き換えた新しい文字列を返します。
@param repl 不正なバイト列を置き換える文字列を指定します。省略した場合
は self の文字エンコーディングが Encoding::UTF_16BE,
Encoding::UTF_16LE, Encoding::UTF_32BE,
Encoding::UTF_32LE, Encoding::UTF_8 のいずれか
の場合は "\uFFFD" を表す文字で、それ以外の場合は "?" で置き
... -
String
# unicode _ normalize(form = :nfc) -> String (18430.0) -
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し た文字列を返します。
self を NFC、NFD、NFKC、NFKD のいずれかの正規化形式で Unicode 正規化し
た文字列を返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。
このメソッドでの "Unicode 文字列" とは、UTF-8、UTF-16BE/LE... -
WIN32OLE
_ TYPE # default _ event _ sources -> [WIN32OLE _ TYPE] (18412.0) -
型が持つソースインターフェイスを取得します。
型が持つソースインターフェイスを取得します。
default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるインターフェイス)を返します。
@return デフォルトのソースインターフェイスをWIN32OLE_TYPEの配列と
して返します。返すのは配列ですが、デフォルトのソースインターフェ
イスは最大でも1インターフェイスです。ソースインターフェイスを持
たない場合は空配列を返します。
tobj = ... -
Object
# trust -> self (18400.0) -
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#untaint と同じ動作をします。
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object#untaint と同じ動作をします。
@see Object#untrusted?,Object#untrust -
Object
# untrust -> self (18400.0) -
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#taint と同じ動作をします。
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object#taint と同じ動作をします。
@see Object#trust,Object#untrusted? -
Object
# untrusted? -> false (18400.0) -
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。 Object#tainted? と同じ動作をします。
このメソッドは Ruby 2.1 から deprecated で、Ruby 3.2 で削除予定です。
Object#tainted? と同じ動作をします。
@see Object#trust,Object#untrust -
String
# unicode _ normalized?(form = :nfc) -> bool (18394.0) -
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か どうかを返します。
self が引数 form で指定された正規化形式で Unicode 正規化された文字列か
どうかを返します。
@param form 正規化形式を :nfc、:nfd、:nfkc、:nfkd のいずれかで指定しま
す。省略した場合は :nfc になります。
@raise Encoding::CompatibilityError self が Unicode 文字列ではない場合
に発生します。
//emlist[例][ruby]{
"a\u0300".unicode_normalized? ... -
String
# gsub(pattern , replace) -> String (18382.0) -
文字列中で pattern にマッチする部分全てを 文字列 replace で置き換えた文字列を生成して返します。
文字列中で pattern にマッチする部分全てを
文字列 replace で置き換えた文字列を生成して返します。
置換文字列 replace 中の \& と \0 はマッチした部分文字列に、
\1 ... \9 は n 番目の括弧の内容に置き換えられます。
置換文字列内では \`、\'、\+ も使えます。
これらは $`、$'、$+ に対応します。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定した... -
String
# sub(pattern , replace) -> String (18382.0) -
文字列中で pattern にマッチした最初の部分を 文字列 replace で置き換えた文字列を生成して返します。
文字列中で pattern にマッチした最初の部分を
文字列 replace で置き換えた文字列を生成して返します。
置換文字列 replace 中の \& と \0 はマッチした部分文字列に、
\1 ... \9 は n 番目の括弧の内容に置き換えられます。
置換文字列内では \`、\'、\+ も使えます。
これらは $`、$'、$+ に対応します。
@param pattern 置き換える文字列のパターンを表す文字列か正規表現。
文字列を指定した場合は全く同じ文字列にだけマッチする
@param replace pattern で指定し...