11973件ヒット
[1-100件を表示]
(0.177秒)
種類
ライブラリ
- English (66)
- ビルトイン (6620)
- abbrev (22)
- benchmark (66)
- bigdecimal (66)
-
bigdecimal
/ math (66) -
cgi
/ core (11) - cmath (42)
- csv (484)
- date (11)
- digest (44)
- erb (33)
- etc (11)
- fileutils (121)
-
irb
/ cmd / help (11) - json (176)
-
json
/ add / date _ time (22) -
json
/ add / exception (11) -
json
/ add / time (11) - logger (55)
- matrix (143)
- mkmf (33)
-
net
/ http (715) - nkf (11)
- objspace (44)
- open-uri (33)
- openssl (88)
- optparse (319)
- pathname (359)
- pp (44)
- prettyprint (11)
- prime (99)
- psych (237)
- pty (11)
- rake (88)
-
rake
/ packagetask (11) - rbconfig (11)
-
rbconfig
/ sizeof (22) - readline (11)
- resolv (11)
-
rexml
/ document (220) -
ripper
/ lexer (11) -
rubygems
/ commands / which _ command (11) -
rubygems
/ custom _ require (11) -
rubygems
/ gem _ path _ searcher (11) -
rubygems
/ requirement (11) -
rubygems
/ version (44) - securerandom (7)
- set (33)
- socket (88)
- stringio (131)
- strscan (132)
- thread (26)
- tsort (128)
- uri (66)
-
webrick
/ httprequest (11) -
webrick
/ httpservlet / cgihandler (11) -
webrick
/ ssl (11) - win32ole (55)
- zlib (11)
クラス
-
ARGF
. class (101) - Addrinfo (44)
- Array (399)
- BasicObject (77)
-
Benchmark
:: Tms (11) - BigDecimal (44)
- CGI (11)
- CSV (286)
-
CSV
:: FieldInfo (11) -
CSV
:: Row (99) -
CSV
:: Table (88) - Class (11)
- Complex (104)
- Data (6)
- Date (11)
- DateTime (22)
-
Digest
:: Base (33) - Dir (365)
- ERB (11)
- Encoding (44)
-
Encoding
:: Converter (55) -
Encoding
:: UndefinedConversionError (11) - Enumerator (57)
-
Enumerator
:: Chain (6) -
Enumerator
:: Lazy (64) - Exception (40)
- File (266)
-
File
:: Stat (33) - Float (41)
-
Gem
:: GemPathSearcher (11) -
Gem
:: Requirement (11) -
Gem
:: Version (44) - Hash (481)
- IO (391)
- IPSocket (11)
-
IRB
:: ExtendCommand :: Help (11) - Integer (292)
-
JSON
:: State (22) - KeyError (12)
- Logger (44)
-
Logger
:: Formatter (11) - MatchData (213)
- Matrix (132)
- Method (108)
- Module (271)
- Mutex (2)
-
Net
:: HTTP (253) -
Net
:: HTTPGenericRequest (88) -
Net
:: HTTPResponse (99) - NilClass (50)
- Numeric (161)
- Object (197)
-
OpenSSL
:: ASN1 :: GraphicString (22) -
OpenSSL
:: BN (33) - OptionParser (308)
- PP (44)
- Pathname (359)
- PrettyPrint (11)
- Prime (22)
-
Prime
:: EratosthenesGenerator (33) -
Prime
:: PseudoPrimeGenerator (44) - Proc (11)
-
Psych
:: ScalarScanner (11) -
Psych
:: Stream (22) -
Psych
:: Visitors :: YAMLTree (44) -
REXML
:: Attributes (44) -
REXML
:: CData (11) -
REXML
:: Child (22) -
REXML
:: DocType (11) -
REXML
:: Element (55) -
REXML
:: Elements (22) -
REXML
:: Entity (11) -
REXML
:: Text (11) -
REXML
:: XPath (33) -
Rake
:: FileList (11) -
Rake
:: InvocationChain (55) -
Rake
:: PackageTask (11) -
Rake
:: TaskArguments (11) - Range (130)
- Rational (110)
- Refinement (3)
- Regexp (66)
-
Resolv
:: DNS :: Name (11) - Ripper (11)
-
RubyVM
:: AbstractSyntaxTree :: Node (6) -
RubyVM
:: InstructionSequence (66) - Set (33)
- Socket (33)
- String (858)
- StringIO (120)
- StringScanner (132)
- Struct (55)
- Symbol (40)
- Thread (214)
-
Thread
:: Backtrace :: Location (77) -
Thread
:: ConditionVariable (22) -
Thread
:: Mutex (18) -
Thread
:: Queue (47) -
Thread
:: SizedQueue (64) - ThreadGroup (11)
- Time (206)
- TracePoint (22)
-
URI
:: FTP (11) -
URI
:: MailTo (11) - UnboundMethod (87)
- UncaughtThrowError (10)
- Vector (11)
-
WEBrick
:: HTTPRequest (11) -
WEBrick
:: HTTPServlet :: CGIHandler (11) -
WIN32OLE
_ EVENT (11) -
WIN32OLE
_ METHOD (11) -
WIN32OLE
_ TYPE (11) -
WIN32OLE
_ TYPELIB (11) -
Zlib
:: GzipWriter (11)
モジュール
- Abbrev (11)
- Benchmark (55)
- BigMath (88)
- CMath (36)
- Digest (11)
-
ERB
:: Util (22) - Enumerable (233)
- FileUtils (121)
- GC (22)
-
GC
:: Profiler (11) - JSON (44)
-
JSON
:: Generator :: GeneratorMethods :: Array (11) -
JSON
:: Generator :: GeneratorMethods :: FalseClass (11) -
JSON
:: Generator :: GeneratorMethods :: Float (11) -
JSON
:: Generator :: GeneratorMethods :: Hash (11) -
JSON
:: Generator :: GeneratorMethods :: Integer (11) -
JSON
:: Generator :: GeneratorMethods :: NilClass (11) -
JSON
:: Generator :: GeneratorMethods :: Object (11) -
JSON
:: Generator :: GeneratorMethods :: String (11) -
JSON
:: Generator :: GeneratorMethods :: String :: Extend (11) -
JSON
:: Generator :: GeneratorMethods :: TrueClass (11) - Kernel (341)
- Marshal (66)
- Math (66)
-
Net
:: HTTPExceptions (11) -
Net
:: HTTPHeader (253) - ObjectSpace (66)
-
OpenSSL
:: ASN1 (22) -
OpenURI
:: Meta (33) -
OptionParser
:: Arguable (11) - PTY (11)
- Psych (116)
-
Rake
:: TaskManager (11) - RbConfig (33)
- Readline (11)
-
RubyVM
:: AbstractSyntaxTree (8) - SecureRandom (7)
- TSort (128)
- URI (44)
-
WEBrick
:: Config (11) -
WIN32OLE
:: VARIANT (11)
オブジェクト
- ENV (28)
キーワード
- != (11)
-
$ CHILD _ STATUS (11) -
$ INPUT _ LINE _ NUMBER (11) -
$ LAST _ MATCH _ INFO (11) -
$ LAST _ PAREN _ MATCH (11) -
$ LAST _ READ _ LINE (11) -
$ LOAD _ PATH (11) -
$ NR (11) -
$ archdir (11) -
$ hdrdir (11) -
$ sitearchdir (11) -
$ ~ (11) - % (39)
- & (22)
- * (33)
- ** (33)
- + (61)
- - (33)
-
/ (32) - < (22)
- << (22)
- <= (22)
- <=> (148)
- == (77)
- === (44)
- =~ (26)
- > (22)
- >= (22)
- CHR2FIX (11)
- CMath (6)
- CONFIG (11)
- Cipher (11)
- ConditionVariable (11)
- DEBUG (11)
- DOSISH 対応 (11)
- E (11)
- FORMAT (22)
- GraphicString (22)
- HTTPServerException (11)
- LIMITS (11)
- Location (11)
-
MAJOR
_ VERSION (11) -
MINOR
_ VERSION (11) - Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 1 . 0 (11) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - NKF (11)
- OPS (11)
- PI (22)
-
RUBY
_ COPYRIGHT (11) -
RUBY
_ PATCHLEVEL (11) - Rubyの起動 (11)
-
SCRIPT
_ LINES _ _ (11) -
SHIFT
_ JIS (11) - SIZEOF (11)
- SSL (11)
-
Shift
_ JIS (11) - SizedQueue (11)
- String (11)
- StringIO (11)
- StringValuePtr (11)
- TreeBuilder (11)
-
VT
_ DISPATCH (11) - WhichCommand (11)
- YAMLTree (11)
- [] (181)
- []= (55)
- ^ (22)
-
_ _ method _ _ (11) - abbrev (22)
-
abort
_ on _ exception (22) -
abort
_ on _ exception= (22) -
absolute
_ path (33) -
absolute
_ path? (5) -
add
_ field (11) -
add
_ heap (11) -
alias
_ method (11) - aliases (11)
- alphanumeric (7)
- angle (11)
-
angle
_ with (11) - append (22)
- arg (11)
- arity (22)
- ascend (11)
- asin (11)
- assoc (11)
- at (11)
- atan (11)
- atime (11)
- backtrace (11)
-
backtrace
_ locations (33) -
base
_ label (11) - basename (11)
-
basic
_ auth (11) - begin (11)
- benchmark (11)
-
bigdecimal
/ math (11) - bind (11)
-
bind
_ call (10) - binread (22)
- binwrite (11)
- birthtime (21)
-
bit
_ length (11) - bm (11)
- bmbm (11)
- body (22)
- body= (11)
-
body
_ permitted? (11) -
body
_ stream (11) -
body
_ stream= (11) - broadcast (11)
- bsearch (44)
-
bsearch
_ index (18) - byteoffset (4)
- bytes (7)
- byteslice (22)
- caller (11)
-
caller
_ locations (22) - captures (11)
- casecmp (22)
- casecmp? (16)
- catch (22)
- cbrt (6)
- ceildiv (2)
- center (11)
- cgi (11)
- chain (6)
- chardev? (11)
- charpos (11)
- chars (22)
- charset (22)
- chdir (66)
- check (22)
-
check
_ circular? (11) -
check
_ until (11) - children (37)
- chmod (22)
-
chmod
_ R (11) - chomp (22)
- chomp! (11)
- chop (22)
- chop! (11)
- chown (44)
-
chown
_ R (11) - chr (33)
- chroot (11)
- chunk (11)
-
chunk
_ while (11) -
class
_ variables (11) - classify (11)
- cleanpath (11)
- close (9)
- code (11)
- coerce (55)
- collect (24)
- collect! (12)
-
collect
_ method (11) - compact! (8)
-
compare
_ by _ identity (11) -
compare
_ by _ identity? (11) - compile (22)
-
compile
_ option (11) - concat (11)
-
connect
_ from (22) -
const
_ defined? (11) -
const
_ get (11) -
const
_ source _ location (5) - constants (11)
-
content
_ length (11) -
content
_ range (11) -
content
_ type (11) - convpath (11)
-
copy
_ stream (22) - cos (11)
- count (11)
-
count
_ nodes (11) -
count
_ objects _ size (11) -
count
_ tdata _ objects (11) - ctime (11)
- curry (10)
-
datetime
_ format (11) -
datetime
_ format= (22) - debug (11)
-
deconstruct
_ keys (2) -
def
_ method (11) - default (22)
-
default
_ proc (11) -
define
_ method (22) -
define
_ singleton _ method (22) - delete (66)
-
delete
_ if (33) - deq (11)
- descend (11)
- difference (6)
- dig (9)
- dirname (11)
- div (22)
- divmod (22)
-
drop
_ while (55) - dump (44)
-
dump
_ stream (11) - each (242)
-
each
_ attribute (11) -
each
_ byte (66) -
each
_ capitalized _ name (11) -
each
_ char (44) -
each
_ child (62) -
each
_ codepoint (66) -
each
_ cons (11) -
each
_ element _ with _ attribute (11) -
each
_ element _ with _ text (11) -
each
_ entry (11) -
each
_ filename (11) -
each
_ grapheme _ cluster (14) -
each
_ index (22) -
each
_ line (132) -
each
_ object (22) -
each
_ pair (66) -
each
_ slice (22) -
each
_ strongly _ connected _ component (32) -
each
_ strongly _ connected _ component _ from (42) -
each
_ with _ index (66) -
each
_ with _ object (22) - empty? (8)
- end (11)
-
end
_ with? (16) - entity (11)
- entries (33)
-
enum
_ for (22) - eql? (66)
- equal? (11)
-
error
_ char (11) - execute (11)
- exists? (9)
- exp (17)
- extract (22)
-
family
_ addrinfo (22) - fdiv (33)
- fetch (51)
- field (11)
- fill (22)
- filter (45)
- filter! (12)
-
find
_ class _ path (11) - finish (22)
- first (11)
- flush (11)
- fnmatch (11)
- fnmatch? (11)
- foreach (77)
- format (22)
- frexp (11)
- gamma (11)
- generate (22)
-
generate
_ line (11) - get (22)
- get2 (22)
-
get
_ fields (11) -
get
_ print (22) -
get
_ text (11) - getaddress (11)
- getc (11)
- getch (11)
- gethostname (11)
- getopts (33)
- gets (24)
- glob (29)
- gm (22)
-
grapheme
_ clusters (14) -
group
_ by (11) - gsub (33)
- gsub! (22)
-
hadamard
_ product (7) - handler= (11)
- hash (123)
- head (11)
- head2 (22)
- header (22)
-
header
_ convert (22) - headers (22)
- help (11)
- helpfile (11)
- hex (11)
- hexdigest (11)
- hexdigest! (11)
- hexencode (11)
- home (22)
- hour (11)
- hstack (22)
-
html
_ escape (11) -
http
_ version (11) -
ignore
_ deadlock= (3) -
import
_ methods (3) - include? (33)
- index (18)
- inherited (11)
- insert (22)
-
insert
_ output (11) - inspect (71)
- instance (22)
-
instance
_ method (11) -
instance
_ methods (11) - intersect? (3)
- intersection (5)
- invert (11)
- invkind (11)
- irb (11)
- join (22)
-
json
_ create (44) -
keep
_ if (22) - key (7)
- label (11)
-
last
_ match (11) -
latest
_ gc _ info (11) - lchmod (11)
- lchown (11)
- length (99)
- lgamma (11)
-
lib
_ dirs _ for (11) - lineno (11)
- lines (30)
- list (11)
- ljust (11)
- load (22)
-
load
_ file (11) -
load
_ stream (22) - local (22)
-
locale
_ charmap (11) - log (23)
- logger (11)
- lshift! (11)
-
main
_ type (11) - map (24)
- map! (12)
-
marshal
_ dump (11) -
marshal
_ load (11) - match (55)
- match? (19)
- matched (11)
- matched? (11)
-
matched
_ size (11) - matches? (11)
- max (33)
- max= (11)
-
max
_ by (44) -
max
_ nesting= (11) - member? (11)
- method (22)
-
method
_ defined? (11) -
method
_ id (11) -
method
_ missing (11) -
method
_ undefined (11) - methods (11)
- min (42)
- minmax (10)
- mkdir (11)
- mkpath (11)
- mktime (22)
- modulo (22)
- month (11)
- mountpoint? (11)
- msg (11)
- name= (9)
- names (11)
- new (251)
- next (11)
-
next
_ sibling= (11) -
num
_ waiting (11) - offset (22)
- on (88)
-
on
_ head (11) -
on
_ tail (11) - open (110)
- optparse (11)
-
original
_ name (22) - pack (19)
- pack テンプレート文字列 (11)
-
package
_ dir _ path (11) - parse (55)
- parse! (11)
-
parse
_ file (8) -
parse
_ line (11) - path (101)
- pathconf (11)
- pathmap (11)
- permutation (22)
- phase (11)
- polar (11)
- pop (11)
- post (22)
- post2 (22)
-
post
_ match (22) - pow (22)
- pp (11)
-
pre
_ match (22) - prepend (11)
-
pretty
_ generate (11) -
pretty
_ unparse (11) -
previous
_ sibling= (11) -
prime
_ fasttest? (11) - priority (11)
- priority= (11)
-
private
_ class _ method (15) -
private
_ instance _ methods (11) -
private
_ method _ defined? (11) -
protected
_ method _ defined? (11) -
proxy
_ basic _ auth (11) -
psych
_ y (11) -
public
_ class _ method (15) -
public
_ instance _ method (11) -
public
_ method (11) -
public
_ method _ defined? (11) - push (11)
- putc (11)
- query (11)
- quo (33)
-
quote
_ char (11) - rake (11)
- range (11)
- range= (22)
-
range
_ length (11) - rassoc (11)
-
raw
_ data (11) -
rb
_ ary _ push (11) -
rb
_ ary _ shift (11) -
rb
_ compile _ cstr (11) -
rb
_ compile _ error (11) -
rb
_ compile _ error _ with _ enc (11) -
rb
_ compile _ file (11) -
rb
_ compile _ string (11) -
rb
_ define _ class _ under (11) -
rb
_ define _ method (11) -
rb
_ eval _ string (11) -
rb
_ eval _ string _ protect (11) -
rb
_ io _ mode _ flags (1) -
rb
_ parser _ while _ loop (11) -
rb
_ scan _ args (11) -
rb
_ thread _ select (1) -
rb
_ thread _ start _ timer (11) -
rb
_ thread _ stop _ timer (11) -
reachable
_ objects _ from (11) - read (22)
-
read
_ body (11) - readchar (22)
- readline (11)
- readlines (68)
- readlink (11)
- realdirpath (11)
- realpath (33)
- realtime (11)
- receiver (11)
- regexp (11)
- reject (22)
- reject! (22)
- relative? (11)
-
relative
_ path _ from (11) - remainder (22)
-
remove
_ entry (11) - reopen (22)
- replace (11)
-
report
_ on _ exception (8) -
report
_ on _ exception= (8) -
request
_ body _ permitted? (11) -
request
_ get (22) -
request
_ head (22) -
request
_ post (22) - require (11)
- response (11)
-
response
_ body _ permitted? (11) - restore (11)
-
reverse
_ each (11) - rewind (11)
-
rexml
/ parsers / ultralightparser (11) - rjust (11)
- rmdir (11)
- round (19)
- rshift! (11)
-
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 8 . 4 feature (11) -
ruby2
_ keywords (5) -
ruby
_ stack _ check (11) -
ruby
_ stack _ length (11) -
rubygems
/ commands / build _ command (11) -
rubygems
/ commands / environment _ command (11) -
rubygems
/ commands / generate _ index _ command (11) -
rubygems
/ commands / install _ command (11) -
rubygems
/ commands / list _ command (11) -
rubygems
/ commands / mirror _ command (11) -
rubygems
/ commands / pristine _ command (11) -
rubygems
/ commands / query _ command (11) -
rubygems
/ commands / search _ command (11) -
rubygems
/ commands / specification _ command (11) -
rubygems
/ commands / uninstall _ command (11) -
rubygems
/ commands / which _ command (11) -
rubygems
/ digest / sha1 (11) -
rubygems
/ digest / sha2 (11) -
rubygems
/ require _ paths _ builder (11) -
rubygems
/ source _ info _ cache (11) -
rubygems
/ source _ info _ cache _ entry (11) -
safe
_ level (7) -
safe
_ load (17) - scrub (33)
- scrub! (33)
-
search
_ convpath (11) -
search
_ full (11) - select (12)
- select! (22)
-
send
_ request (11) - separator (11)
- seplist (11)
-
set
_ debug _ output (11) -
set
_ range (33) -
set
_ trace _ func (11) -
sev
_ threshold (11) -
sharing
_ detection (11) -
sharing
_ detection= (11) - shift (66)
- signal (11)
- sin (22)
- sin! (6)
-
singleton
_ method (11) -
singleton
_ method _ added (11) -
singleton
_ method _ removed (11) -
singleton
_ method _ undefined (11) -
singleton
_ methods (11) - size (99)
- sleep (9)
- slice (57)
- slice! (33)
-
slice
_ when (21) -
source
_ location (22) - split (39)
- sprintf (11)
- sprintf フォーマット (11)
- sqrt (17)
- squeeze (11)
- squeeze! (11)
-
st
_ delete _ safe (11) - start (55)
-
start
_ with? (16) - stat (11)
- step (24)
- stop (11)
- strftime (11)
- string (11)
-
strongly
_ connected _ components (11) - sub (33)
- sub! (22)
-
sub
_ type (11) -
subdomain
_ of? (11) - succ (11)
- summarize (22)
-
summary
_ indent (11) -
summary
_ indent= (11) -
summary
_ width (11) -
summary
_ width= (11) -
super
_ method (10) - synchronize (11)
-
synthesize
_ file _ task (11) - syscall (11)
- sysopen (11)
- table (11)
-
take
_ while (66) - tcp (22)
-
test
/ unit (1) - text (11)
-
thread
_ variable _ set (11) - throw (11)
- thursday? (11)
-
to
_ a (44) -
to
_ csv (11) -
to
_ enum (22) -
to
_ h (28) -
to
_ json (121) -
to
_ path (24) -
to
_ s (138) -
token
_ match (11) - tokenize (11)
- touch (11)
-
trace
_ var (22) -
transform
_ keys (17) -
transform
_ keys! (17) -
transform
_ values (16) -
transform
_ values! (16) - truncate (22)
-
try
_ convert (11) - tsort (11)
-
tsort
_ each (32) - unbind (11)
- ungetc (11)
- union (6)
- unlink (22)
- unpack (11)
- unparse (11)
- unshift (11)
-
untrace
_ var (11) - uptodate? (11)
- utc (22)
- value (11)
-
values
_ at (22) -
warn
_ unless _ e _ option (11) -
warning
_ unless _ e _ option (11) - with (2)
-
with
_ defaults (11) -
with
_ index (54) -
with
_ object (22) -
world
_ readable? (11) -
world
_ writable? (11) - write (33)
-
write
_ headers? (11) - xpath (11)
- y (11)
-
yield
_ self (12) - | (22)
- 正規表現 (11)
検索結果
先頭5件
-
irb (26290.0)
-
irb は Interactive Ruby の略です。 irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
...irb は Interactive Ruby の略です。
irb を使うと、Ruby の式を標準入力から簡単に入力・実行することができます。
=== irb の使い方
Ruby さえ知っていれば irb を使うのは簡単です。
irb コマンドを実行すると、以下のようなプロン......。
$ irb
irb(main):001:0>
あとは Ruby の式を入力するだけで、その式が実行され、結果が表示されます。
irb(main):001:0> 1+2
3
irb(main):002:0> class Foo
irb(main):003:1> def foo
irb(main):004:2> print 1
irb(main):005:2> end
irb(main):006:1>......ibrary ruby -r と同じ
-I ruby -I と同じ
-U ruby -U と同じ
-E enc ruby -E と同じ
--verbose これから実行する行を表示する
--noverbose これから実行する行を表示しない (デフォルト)
--ech... -
WEBrick
:: HTTPServlet :: CGIHandler :: Ruby -> String (24217.0) -
Ruby のパスを返します。
...
Ruby のパスを返します。... -
Prime
:: PseudoPrimeGenerator # each _ with _ index -> Enumerator (21306.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
Prime
:: PseudoPrimeGenerator # each _ with _ index {|prime , index| . . . } -> self (21306.0) -
与えられたブロックに対して、素数を0起点の連番を渡して評価します。
...を返します。 ブロックを与えられなかった場合は Enumerator を返します。
//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end
# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}
@see Enumerator#with_index... -
ERB
:: Util . # h(s) -> String (21207.0) -
文字列 s を HTML用にエスケープした文字列を返します。
... HTML用にエスケープした文字列を返します。
文字列 s 中に含まれる &"<> を、実体参照 & " < > にそれぞれ変更した文字列を返します
(CGI.escapeHTMLとほぼ同じです)。
@param s HTMLエスケープを行う文字列
//emlist[例][ruby......]{
require "erb"
include ERB::Util
puts html_escape("is a > 0 & a < 10?")
# is a > 0 & a < 10?
//}... -
Object
# define _ singleton _ method(symbol , method) -> Symbol (18430.0) -
self に特異メソッド name を定義します。
...bol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class << self......def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Enumerable
# each _ with _ index(*args) {|item , index| . . . } -> self (18424.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with......_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Object
# define _ singleton _ method(symbol) { . . . } -> Symbol (18330.0) -
self に特異メソッド name を定義します。
...bol メソッド名を String または Symbol で指定します。
@param method Proc、Method あるいは UnboundMethod の
いずれかのインスタンスを指定します。
@return メソッド名を表す Symbol を返します。
//emlist[][ruby]{
class A
class << self......def class_name
to_s
end
end
end
A.define_singleton_method(:who_am_i) do
"I am: #{class_name}"
end
A.who_am_i # ==> "I am: A"
guy = "Bob"
guy.define_singleton_method(:hello) { "#{self}: Hello there!" }
guy.hello #=> "Bob: Hello there!"
//}... -
Enumerable
# each _ with _ index(*args) -> Enumerator (18324.0) -
要素とそのインデックスをブロックに渡して繰り返します。
...ith_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。
@param args イテレータメソッド (each など) にそのまま渡されます。
//emlist[例][ruby]{
[5, 10, 15].each_with......_index do |n, idx|
p [n, idx]
end
# => [5, 0]
# [10, 1]
# [15, 2]
//}
//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end
# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}
@see Enumerator#with_index... -
Enumerable
# each _ with _ object(obj) -> Enumerator (18318.0) -
与えられた任意のオブジェクトと要素をブロックに渡し繰り返し、最初に与えられたオブジェクトを返します。
...返します。
ブロックを省略した場合は Enumerator を返します。
@param obj 任意のオブジェクトを指定します。
//emlist[例][ruby]{
evens = (1..10).each_with_object([]) {|i, a| a << i*2 }
# => [2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
//}
@see Enumerator#with_object...