ライブラリ
- ビルトイン (4981)
- bigdecimal (84)
-
cgi
/ core (12) - csv (198)
- date (4)
- digest (72)
- erb (48)
- fiber (8)
- fiddle (12)
-
fiddle
/ import (12) - json (240)
-
json
/ add / bigdecimal (12) -
json
/ add / complex (12) -
json
/ add / date (12) -
json
/ add / date _ time (12) -
json
/ add / exception (12) -
json
/ add / range (12) -
json
/ add / rational (12) -
json
/ add / regexp (12) -
json
/ add / struct (12) -
json
/ add / time (12) - kconv (12)
- logger (228)
- matrix (761)
- mkmf (24)
- monitor (2)
-
net
/ http (300) - open-uri (60)
- openssl (24)
- optparse (360)
- ostruct (19)
- pathname (87)
- psych (84)
- rake (96)
-
rake
/ packagetask (36) -
rexml
/ document (564) -
rexml
/ streamlistener (12) - ripper (12)
-
ripper
/ filter (12) -
ripper
/ lexer (36) -
rubygems
/ gem _ path _ searcher (12) -
rubygems
/ installer (12) -
rubygems
/ requirement (36) -
rubygems
/ specification (24) -
rubygems
/ version (24) - set (23)
- socket (12)
- stringio (328)
- strscan (516)
- tsort (58)
- uri (36)
- win32ole (24)
クラス
-
ARGF
. class (108) - Addrinfo (12)
- Array (93)
- BigDecimal (96)
- Binding (7)
- CGI (12)
- CSV (60)
-
CSV
:: FieldInfo (12) -
CSV
:: Row (42) -
CSV
:: Table (60) - Class (12)
- Complex (36)
- Data (12)
- Date (14)
- DateTime (14)
-
Digest
:: Base (72) - Dir (55)
- ERB (48)
- Encoding (48)
-
Encoding
:: Converter (84) -
Encoding
:: InvalidByteSequenceError (12) -
Encoding
:: UndefinedConversionError (12) - Exception (92)
- FalseClass (24)
- Fiber (18)
-
Fiddle
:: Function (12) - File (36)
-
File
:: Stat (24) - Float (36)
-
Gem
:: GemPathSearcher (12) -
Gem
:: Installer (12) -
Gem
:: Requirement (36) -
Gem
:: Specification (24) -
Gem
:: Version (24) - Hash (100)
- IO (82)
- Integer (72)
-
JSON
:: Parser (12) -
JSON
:: State (120) - Logger (228)
- MatchData (160)
- Matrix (713)
-
Matrix
:: LUPDecomposition (12) - Method (36)
- Module (288)
- Monitor (2)
- Mutex (2)
-
Net
:: HTTPGenericRequest (60) -
Net
:: HTTPResponse (96) - NilClass (12)
- Numeric (12)
- Object (99)
-
OpenSSL
:: BN (24) - OpenStruct (19)
- OptionParser (312)
- Pathname (87)
- Proc (36)
-
Psych
:: Nodes :: Node (12) -
Psych
:: ScalarScanner (12) -
Psych
:: Stream (24) -
Psych
:: Visitors :: YAMLTree (36) -
REXML
:: Attribute (36) -
REXML
:: Attributes (156) -
REXML
:: CData (24) -
REXML
:: DocType (108) -
REXML
:: Document (36) -
REXML
:: Element (144) -
REXML
:: Entity (12) -
REXML
:: Instruction (24) -
REXML
:: Text (24) -
Rake
:: Application (48) -
Rake
:: FileList (12) -
Rake
:: InvocationChain (12) -
Rake
:: PackageTask (36) - Random (12)
- Range (50)
- Rational (48)
- Regexp (129)
- Ripper (12)
-
Ripper
:: Filter (12) -
Ripper
:: Lexer (36) -
RubyVM
:: AbstractSyntaxTree :: Node (49) -
RubyVM
:: InstructionSequence (130) - Set (32)
- SignalException (12)
- String (2130)
- StringIO (328)
- StringScanner (516)
- Struct (295)
- Symbol (5)
- Thread (90)
-
Thread
:: Backtrace :: Location (84) -
Thread
:: Mutex (10) - Time (80)
- TracePoint (201)
- TrueClass (60)
-
URI
:: MailTo (36) - UnboundMethod (36)
- UncaughtThrowError (11)
- Vector (36)
-
WIN32OLE
_ TYPE (12) -
WIN32OLE
_ TYPELIB (12)
モジュール
- Enumerable (48)
-
Fiddle
:: Importer (12) - GC (12)
-
JSON
:: Generator :: GeneratorMethods :: Array (12) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (12) -
JSON
:: Generator :: GeneratorMethods :: Float (12) -
JSON
:: Generator :: GeneratorMethods :: Hash (12) -
JSON
:: Generator :: GeneratorMethods :: Integer (12) -
JSON
:: Generator :: GeneratorMethods :: NilClass (12) -
JSON
:: Generator :: GeneratorMethods :: Object (12) -
JSON
:: Generator :: GeneratorMethods :: String (12) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (12) - Kernel (24)
-
Net
:: HTTPHeader (144) -
OpenURI
:: Meta (60) -
OptionParser
:: Arguable (48) -
REXML
:: StreamListener (12) -
Rake
:: TaskManager (24) - TSort (58)
キーワード
- % (12)
- & (12)
- * (36)
- + (12)
- +@ (10)
- -@ (10)
- << (36)
- <=> (12)
- == (36)
- === (24)
- =~ (24)
- [] (204)
- []= (115)
- ^ (12)
-
_ dump (24) -
_ load (12) -
absolute
_ path (24) - accept (12)
- add (24)
-
add
_ attribute (24) -
add
_ attributes (12) -
add
_ element (12) -
add
_ trace _ func (12) - adjugate (12)
- antisymmetric? (7)
-
arg
_ config (12) -
array
_ nl (12) -
array
_ nl= (12) -
as
_ list (12) - asctime (12)
- attr (36)
-
attr
_ accessor (12) -
attr
_ reader (12) -
attr
_ writer (12) - attribute (12)
-
attribute
_ of (12) -
attributes
_ of (12) - autoload? (12)
- b (12)
- backtrace (24)
-
backtrace
_ locations (36) -
base
_ label (24) -
basic
_ auth (12) -
beginning
_ of _ line? (12) - binding (12)
- binread (12)
- body (24)
-
body
_ stream (12) -
body
_ stream= (12) - bol? (12)
- byteindex (3)
- byterindex (3)
- bytes (50)
- bytesize (12)
- byteslice (36)
- call (12)
-
callee
_ id (12) - canonname (12)
- capitalize (12)
- capitalize! (12)
- captures (12)
- casecmp (12)
- casecmp? (9)
- center (12)
- charpos (12)
- chars (24)
- charset (24)
- check (12)
-
check
_ until (12) - children (26)
- chomp (12)
- chomp! (12)
- chop (12)
- chop! (12)
- chr (36)
-
class
_ variables (12) - clear (24)
- closed? (12)
- code (12)
- codepoints (24)
- coerce (12)
-
cofactor
_ expansion (12) -
col
_ sep (12) - collect (24)
- collect! (14)
- column (24)
-
column
_ vectors (12) - component (12)
- concat (33)
- conj (12)
- conjugate (12)
-
const
_ defined? (12) -
const
_ get (12) -
const
_ source _ location (12) - constants (12)
- content (12)
-
content
_ encoding (12) -
content
_ type (24) - convert (12)
- count (12)
- covector (12)
-
create
_ makefile (12) - crypt (12)
- ctime (12)
-
datetime
_ format (12) - debug (24)
- deconstruct (14)
-
deconstruct
_ keys (20) - dedup (3)
-
default
_ argv (12) -
defined
_ class (12) - delete (36)
- delete! (12)
-
delete
_ all (12) -
delete
_ attribute (12) -
delete
_ prefix (8) -
delete
_ prefix! (8) -
delete
_ suffix (8) -
delete
_ suffix! (8) - det (12)
- determinant (12)
- dev (12)
- dig (10)
- digest (12)
- digest! (12)
- disable (24)
- disasm (12)
- disassemble (12)
- downcase (12)
- downcase! (12)
- dump (12)
- each (84)
-
each
_ attribute (12) -
each
_ byte (48) -
each
_ char (24) -
each
_ child (24) -
each
_ codepoint (24) -
each
_ element _ with _ attribute (12) -
each
_ entry (39) -
each
_ grapheme _ cluster (16) -
each
_ line (48) -
each
_ pair (24) -
each
_ strongly _ connected _ component (23) -
each
_ strongly _ connected _ component _ from (23) -
each
_ with _ index (24) - eigen (12)
- eigensystem (12)
- element (12)
- empty? (24)
- enable (24)
- encode (36)
- encode! (24)
- encoding (24)
-
end
_ with? (12) - entities (12)
- entity (24)
- entitydecl (12)
- entries (31)
-
entrywise
_ product (8) - environment (12)
- eos? (12)
- eql? (24)
- error (24)
-
error
_ bytes (12) -
error
_ char (12) - eval (12)
-
eval
_ script (7) - event (12)
- exist? (12)
-
external
_ id (12) - fatal (24)
- fetch (36)
- filename (48)
- filename= (12)
- filter (14)
-
find
_ index (36) - finish (12)
-
first
_ column (7) -
first
_ lineno (19) -
force
_ encoding (12) -
formatted
_ program _ filename (12) - formatter (12)
- ftype (12)
-
garbage
_ collect (12) -
get
_ attribute (12) -
get
_ attribute _ ns (12) -
get
_ byte (12) -
get
_ fields (12) - getbyte (36)
- getc (24)
- getch (12)
- gets (48)
-
grapheme
_ clusters (16) - gsub (48)
- gsub! (48)
-
hadamard
_ product (8) - hash (24)
- header (24)
- headers (24)
- help (12)
- helpfile (12)
- hex (12)
- hexdigest (12)
- hexdigest! (12)
- hstack (12)
-
http
_ version (12) - imag (12)
- imaginary (12)
- include? (12)
- indent (12)
- indent= (12)
- index (48)
- info (24)
-
inplace
_ mode (12) - insert (12)
-
insert
_ output (12) - inspect (400)
-
instance
_ methods (12) -
instruction
_ sequence (7) - integer? (12)
- intern (12)
- inv (12)
- inverse (12)
- iseuc (12)
- join (12)
- label (24)
-
laplace
_ expansion (12) -
last
_ column (7) -
last
_ comment (12) -
last
_ description (12) -
last
_ lineno (7) - length (36)
- lex (12)
-
lib
_ dirs _ for (12) - lineno (24)
- lines (38)
- ljust (12)
- log (24)
- lstrip (12)
- lstrip! (12)
- lup (12)
-
lup
_ decomposition (12) -
main
_ type (12) - map (24)
- map! (14)
- match (48)
- match? (30)
- matched (12)
- matched? (12)
-
matched
_ size (12) - members (12)
- method (24)
-
method
_ defined? (12) -
method
_ id (12) - methods (12)
- minor (24)
-
module
_ function (12) - msg (12)
- name (65)
- name= (10)
-
named
_ captures (12) - names (36)
- namespace (24)
- namespaces (24)
- next (12)
- next! (12)
-
object
_ nl (12) -
object
_ nl= (12) - oct (12)
- on (36)
- ord (12)
- order (48)
- order! (48)
-
original
_ dir (12) - pack (21)
-
package
_ dir (12) -
package
_ dir _ path (12) - parameters (7)
- parse (36)
- parse! (24)
-
parse
_ csv (12) - partition (12)
- path (99)
- peek (12)
- peep (12)
- permute (24)
- permute! (24)
- pointer (12)
- pointer= (12)
- pos (12)
- pos= (24)
-
post
_ match (24) -
pre
_ match (24) - pread (8)
- prefix (12)
- prefixes (24)
- prepend (21)
-
pretty
_ print (12) -
prime
_ fasttest? (12) - print (24)
- printf (12)
- private (12)
-
private
_ instance _ methods (12) -
private
_ method _ defined? (12) - progname (12)
-
program
_ name (12) -
protected
_ method _ defined? (12) -
proxy
_ basic _ auth (12) - public (24)
-
public
_ method _ defined? (12) - push (12)
- putback (24)
- puts (12)
- pwrite (8)
-
quote
_ char (12) - raise (6)
-
raised
_ exception (12) - rakefile (12)
- rank (12)
- read (24)
-
read
_ body (24) - readbyte (12)
- readchar (24)
- readline (12)
- readlines (48)
- real (12)
- real? (12)
- rect (12)
- rectangular (12)
- regular? (12)
- release (12)
- reopen (24)
- replace (12)
- replacement (12)
- replacement= (12)
- reset (12)
- rest (12)
- rest? (12)
-
rest
_ size (12) - restsize (12)
- result (12)
-
return
_ value (12) - reverse (12)
- reverse! (12)
- rindex (12)
- rjust (12)
- row (24)
-
row
_ sep (12) -
row
_ vectors (12) - rpartition (12)
- rstrip (12)
- rstrip! (12)
-
rubygems
_ version (12) - scan (36)
-
scan
_ full (12) -
scan
_ until (12) - scrub (36)
- scrub! (36)
-
search
_ full (12) - select (24)
- self (12)
-
set
_ backtrace (12) -
set
_ trace _ func (12) - setbyte (12)
- signm (12)
-
singleton
_ methods (12) - size (36)
-
skew
_ symmetric? (7) - skip (12)
-
skip
_ until (12) - slice (72)
- slice! (72)
- solve (12)
- source (24)
-
source
_ location (43) - space (12)
- space= (12)
-
space
_ before (12) -
space
_ before= (12) - split (31)
- squeeze (12)
- squeeze! (12)
- src (12)
-
stand
_ alone? (12) - start (36)
-
start
_ with? (12) - status (12)
- strftime (12)
- string (36)
- string= (12)
- strip (12)
- strip! (12)
-
strongly
_ connected _ components (12) - struct (12)
- sub (36)
- sub! (36)
-
sub
_ type (12) - subtract (12)
- succ (12)
- succ! (12)
- sum (12)
-
summary
_ indent (12) - swapcase (12)
- swapcase! (12)
- system (12)
- syswrite (12)
- target (12)
- terminate (12)
- text (12)
-
to
_ a (91) -
to
_ binary (10) -
to
_ c (12) -
to
_ csv (36) -
to
_ f (12) -
to
_ h (38) -
to
_ i (12) -
to
_ json (228) -
to
_ mailtext (12) -
to
_ path (27) -
to
_ r (12) -
to
_ rfc822text (12) -
to
_ ruby (12) -
to
_ s (510) -
to
_ str (24) -
to
_ string (12) -
to
_ sym (12) - tokenize (24)
-
tr
_ s (12) -
tr
_ s! (12) - trace (12)
- transfer (12)
- transform (12)
-
transform
_ keys (20) -
transform
_ keys! (20) -
transform
_ values (18) -
transform
_ values! (18) - transpose (12)
- truncate (96)
- trust (9)
-
try
_ lock (12) - type (7)
- undump (8)
- ungetc (12)
-
unicode
_ normalize (11) -
unicode
_ normalize! (11) -
unicode
_ normalized? (11) - unknown (24)
- unpack (12)
- unpack1 (9)
- unscan (12)
- untrust (9)
- untrusted? (9)
- upcase (12)
- upcase! (12)
- upto (12)
-
valid
_ encoding? (12) - value (24)
- values (12)
-
values
_ at (24) - ver (12)
- version (24)
- vstack (12)
-
wait
_ for _ cond (2) - warn (24)
- write (36)
- xpath (12)
- zone (12)
- | (12)
検索結果
先頭5件
-
String
# tr(pattern , replace) -> String (30474.0) -
pattern 文字列に含まれる文字を検索し、 それを replace 文字列の対応する文字に置き換えます。
...pattern 文字列に含まれる文字を検索し、
それを replace 文字列の対応する文字に置き換えます。
pattern の形式は tr(1) と同じです。つまり、
`a-c' は a から c を意味し、"^0-9" のように
文字列の先頭が `^' の場合は指定文字以外......が pattern の範囲よりも小さい場合は、
replace の最後の文字が無限に続くものとして扱われます。
@param pattern 置き換える文字のパターン
@param replace pattern で指定した文字を置き換える文字
//emlist[例][ruby]{
p "foo".tr("f", "X")......oo"
p "foo".tr('a-z', 'A-Z') # => "FOO"
p "FOO".tr('A-Z', 'a-z') # => "foo"
# シーザー暗号の復号
p "ORYV".tr("A-Z", "D-ZA-C") # => "RUBY"
# 全角英数字といくつかの記号の半角化
email = "ruby−lang@example.com"
p email.tr("0-9... -
Matrix
# tr -> Integer | Float | Rational | Complex (30208.0) -
トレース (trace) を返します。
...トレース (trace) を返します。
行列のトレース (trace) とは、対角要素の和です。
//emlist[例][ruby]{
require 'matrix'
Matrix[[7,6], [3,9]].trace # => 16
//}
trace は正方行列でのみ定義されます。
@raise ExceptionForMatrix::ErrDimensionMismatch 行列が... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (18507.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...pt_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("put......s 'hello'")
end
//}
@raise RuntimeError :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
String
# tr _ s(pattern , replace) -> String (18480.0) -
文字列の中に pattern 文字列に含まれる文字が存在したら、 replace 文字列の対応する文字に置き換えます。さらに、 置換した部分内に同一の文字の並びがあったらそれを 1 文字に圧縮します。
...字列の中に pattern 文字列に含まれる文字が存在したら、
replace 文字列の対応する文字に置き換えます。さらに、
置換した部分内に同一の文字の並びがあったらそれを 1 文字に圧縮します。
pattern の形式は tr(1) と同じです。......が pattern の範囲よりも小さい場合、
replace の最後の文字が無限に続くものとして扱われます。
@param pattern 置き換える文字のパターン
@param replace pattern で指定した文字を置き換える文字
//emlist[例][ruby]{
p "gooooogle".tr_s("o",......# => "gXgle"
p "gooooogle".tr_s("a-z", "A-Z") # => "GOGLE"
//}
注意:
一般に、tr_s を tr と squeeze で置き換えることはできません。
tr と squeeze の組みあわせでは tr の置換後の文字列全体を squeeze しますが、
tr_s は置換された部分だけ... -
String
# lstrip -> String (18429.0) -
文字列の先頭にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...にある空白文字を全て取り除いた新しい文字列を返します。
空白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".lstrip #=> "abc\n"
p "\t abc\n".lstrip #=> "abc\n"
p "abc\n".lstrip #=> "abc\n"
//}
@see String#strip, String#rstrip... -
String
# rstrip -> String (18429.0) -
文字列の末尾にある空白文字を全て取り除いた新しい文字列を返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...白文字の定義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc\n".rstrip #=> " abc"
p " abc \t\r\n\0".rstrip #=> " abc"
p " abc".rstrip #=> " abc"
p " abc\0 ".rstrip #=> " abc"
str = "abc\n"
p str.rstrip #=> "abc"
p str #=> "abc\n"......(元の文字列は変化しない)
//}
@see String#lstrip,String#strip... -
StringScanner
# string -> String (18425.0) -
スキャン対象にしている文字列を返します。
...mlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.string # => "test string"
//}
返り値は freeze されていません。
//emlist[例][ruby]{
require 'strscan'
s = StringScanner.new('test string')
s.string.frozen? # => false
//}
なお、このメソッドは String......仕様に依存したコードを書かないようにしましょう。
//emlist[例][ruby]{
require 'strscan'
str = 'test string'
s = StringScanner.new(str)
s.string == str # => true
s.string.eql?(str) # => true (将来は false になる可能性がある)
//}
また、返り値の文字列......かないでください。
//emlist[例][ruby]{
require 'strscan'
str = 'test string'
s = StringScanner.new(str)
s.string.replace("0123")
s.scan(/\w+/) # => "0123" (将来は "test" が返る可能性あり)
str # => "0123" (将来は "test string" が返る可能性あり)
//}... -
String
# strip -> String (18423.0) -
文字列先頭と末尾の空白文字を全て取り除いた文字列を生成して返します。 空白文字の定義は " \t\r\n\f\v\0" です。
...義は " \t\r\n\f\v\0" です。
//emlist[例][ruby]{
p " abc \r\n".strip #=> "abc"
p "abc\n".strip #=> "abc"
p " abc".strip #=> "abc"
p "abc".strip #=> "abc"
p " \0 abc \0".strip #=> "abc"
str = "\tabc\n"
p str.strip #=> "abc"
p str......#=> "\tabc\n" (元の文字列は変化しない)
//}
@see String#lstrip, String#rstrip... -
Matrix
# entrywise _ product(m) -> Matrix (18407.0) -
アダマール積(要素ごとの積)を返します。
...ダマール積(要素ごとの積)を返します。
@raise ExceptionForMatrix::ErrDimensionMismatch 行や列の要素数が一致しない時に発生します。
//emlist[例][ruby]{
require 'matrix'
Matrix[[1,2], [3,4]].hadamard_product(Matrix[[1,2], [3,2]]) # => Matrix[[1, 4], [9, 8]]
//}... -
REXML
:: Attributes # each _ attribute {|attribute| . . . } -> () (18407.0) -
各属性に対しブロックを呼び出します。
...ML::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/a").......first
a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...