種類
ライブラリ
- ビルトイン (129)
- bigdecimal (1)
-
cgi
/ core (1) - csv (3)
- find (2)
- ipaddr (2)
-
irb
/ context (7) -
irb
/ inspector (7) -
irb
/ magic-file (1) - matrix (2)
-
minitest
/ spec (6) - monitor (1)
-
net
/ smtp (1) - openssl (2)
- optparse (1)
- ostruct (3)
- pp (2)
- psych (4)
- rake (6)
-
rake
/ gempackagetask (5) -
rdoc
/ context (1) -
rdoc
/ markup (1) -
rexml
/ document (2) -
rubygems
/ builder (1) -
rubygems
/ command (3) -
rubygems
/ commands / build _ command (1) -
rubygems
/ commands / dependency _ command (2) -
rubygems
/ commands / lock _ command (1) -
rubygems
/ commands / specification _ command (1) -
rubygems
/ commands / which _ command (1) -
rubygems
/ dependency _ installer (1) -
rubygems
/ dependency _ list (5) -
rubygems
/ doc _ manager (1) -
rubygems
/ exceptions (1) -
rubygems
/ format (2) -
rubygems
/ gem _ path _ searcher (6) -
rubygems
/ indexer (4) -
rubygems
/ installer (4) -
rubygems
/ old _ format (2) -
rubygems
/ package / tar _ input (2) -
rubygems
/ remote _ fetcher (1) -
rubygems
/ require _ paths _ builder (1) -
rubygems
/ requirement (1) -
rubygems
/ server (2) -
rubygems
/ source _ index (14) -
rubygems
/ source _ info _ cache (2) -
rubygems
/ spec _ fetcher (14) -
rubygems
/ specification (121) -
rubygems
/ uninstaller (7) -
rubygems
/ validator (1) - scanf (18)
- set (1)
-
shell
/ command-processor (1) -
shell
/ filter (1) - socket (12)
- strscan (1)
- sync (1)
- uri (2)
-
webrick
/ httputils (1) -
win32
/ registry (1) - win32ole (1)
- zlib (1)
クラス
-
ARGF
. class (4) - Addrinfo (3)
- Array (2)
- BasicObject (3)
- BigDecimal (1)
- Bignum (2)
- CGI (1)
- CSV (1)
-
CSV
:: Row (1) -
CSV
:: Table (1) - Complex (1)
- Dir (1)
- Encoding (10)
-
Encoding
:: Converter (1) - Exception (1)
- FalseClass (2)
- Fixnum (2)
- Float (2)
-
Gem
:: Builder (1) -
Gem
:: Command (3) -
Gem
:: Commands :: BuildCommand (1) -
Gem
:: Commands :: DependencyCommand (2) -
Gem
:: Commands :: LockCommand (1) -
Gem
:: Commands :: WhichCommand (1) -
Gem
:: DependencyInstaller (1) -
Gem
:: DependencyList (5) -
Gem
:: DocManager (1) -
Gem
:: Format (2) -
Gem
:: GemPathSearcher (6) -
Gem
:: Indexer (4) -
Gem
:: Installer (4) -
Gem
:: OldFormat (2) -
Gem
:: Package :: TarInput (2) -
Gem
:: RemoteFetcher (1) -
Gem
:: Requirement (1) -
Gem
:: Server (2) -
Gem
:: SourceIndex (14) -
Gem
:: SourceInfoCache (2) -
Gem
:: SpecFetcher (13) -
Gem
:: Specification (120) -
Gem
:: Uninstaller (7) -
Gem
:: Validator (1) - Hash (2)
- IPAddr (2)
-
IRB
:: Context (7) -
IRB
:: Inspector (4) - Integer (2)
- MatchData (1)
- Matrix (1)
- Method (5)
-
MiniTest
:: Spec (5) - Module (8)
-
Net
:: SMTP (1) - Object (10)
-
OpenSSL
:: HMAC (1) - OpenStruct (3)
-
OptionParser
:: ParseError (1) - Proc (2)
-
Process
:: Status (1) -
RDoc
:: Context :: Section (1) -
RDoc
:: Markup (1) -
RDoc
:: Options (1) -
REXML
:: CData (1) -
REXML
:: Text (1) -
Rake
:: FileList (2) -
Rake
:: GemPackageTask (4) -
Rake
:: Task (1) -
Rake
:: TaskArguments (2) - Range (4)
- Rational (1)
- Regexp (2)
-
RubyVM
:: InstructionSequence (1) -
Scanf
:: FormatSpecifier (11) -
Scanf
:: FormatString (4) - Set (1)
-
Shell
:: CommandProcessor (1) -
Shell
:: Filter (1) - Socket (3)
-
Socket
:: AncillaryData (2) -
Socket
:: Ifaddr (1) - String (4)
- StringScanner (1)
- Struct (2)
- Symbol (2)
- Thread (2)
-
Thread
:: Backtrace :: Location (1) - TracePoint (1)
- TrueClass (1)
- UnboundMethod (2)
- Vector (1)
-
WIN32OLE
_ TYPE (1) -
Win32
:: Registry (1) -
Zlib
:: GzipFile :: Error (1)
モジュール
- Find (2)
-
Gem
:: RequirePathsBuilder (1) - IRB (1)
- Kernel (32)
- ObjectSpace (2)
-
OpenSSL
:: OCSP (1) - Signal (2)
-
Socket
:: Constants (3) -
Sync
_ m (1) - URI (2)
-
WEBrick
:: HTTPUtils (1)
オブジェクト
- ENV (1)
-
IRB
:: MagicFile (1) - main (2)
キーワード
-
$ -0 (1) -
$ -F (1) -
$ -I (1) -
$ -K (1) -
$ -W (1) -
$ -a (1) -
$ -d (1) -
$ -i (1) -
$ -l (1) -
$ -p (1) -
$ -v (1) -
$ -w (1) -
$ / (1) -
$ : (1) -
$ ; (1) -
$ > (1) -
$ DEBUG (1) -
$ KCODE (1) -
$ LOAD _ PATH (1) -
$ SAFE (1) -
$ VERBOSE (1) -
$ stdout (1) - === (3)
-
AF
_ UNSPEC (2) - ARGF (1)
- Alias (1)
-
CURRENT
_ SPECIFICATION _ VERSION (1) - DATA (1)
-
ENCODING
_ SPEC _ RE (1) - ENV (1)
- Encoding (1)
- FormatSpecifier (1)
- GemPackageTask (1)
- Hash (1)
-
INADDR
_ UNSPEC _ GROUP (2) - INSPECTORS (1)
-
ISO
_ 2022 _ JP _ KDDI (1) - InspectKey (1)
- Inspector (2)
- InvalidSpecificationException (1)
-
MARSHAL
_ FIELDS (1) - Mapping (1)
- MonitorMixin (1)
-
NONEXISTENT
_ SPECIFICATION _ VERSION (1) -
NO
_ INSPECTING _ IVARS (1) -
PF
_ UNSPEC (2) - Proc (1)
-
REVOKED
_ STATUS _ UNSPECIFIED (1) - Range (1)
- Regexp (1)
- Ruby プログラムの実行 (1)
- Rubyで使われる記号の意味(正規表現の複雑な記号は除く) (1)
- Rubyの起動 (1)
- Ruby用語集 (1)
-
SJIS
_ KDDI (1) - SPECIAL (1)
-
SPECIAL
_ CONST _ P (1) -
SPECIAL
_ RETURN (1) -
SPECIFICATION
_ VERSION _ HISTORY (1) - SPECIFIERS (1)
-
STATELESS
_ ISO _ 2022 _ JP _ KDDI (1) - Scalar (1)
- SecurityError (1)
- Sequence (1)
- Spec (1)
- SpecFetcher (1)
- Specification (1)
- SpecificationCommand (1)
-
Stateless
_ ISO _ 2022 _ JP _ KDDI (1) - String (1)
- TODAY (1)
- Thread (1)
-
UTF8
_ KDDI (1) - [] (1)
-
_ _ inspect _ _ (1) -
_ dump (1) -
_ load (1) - ` (1)
- abbreviate (1)
-
accept
_ charset= (1) - add (1)
-
add
_ bindir (1) -
add
_ dependency (1) -
add
_ development _ dependency (1) -
add
_ runtime _ dependency (1) -
add
_ spec (1) -
add
_ special (1) -
add
_ specific _ extra _ args (1) -
add
_ specs (1) - after (1)
-
alias
_ method (1) -
array
_ attribute (1) -
array
_ attributes (1) -
ask
_ if _ ok (1) -
assign
_ defaults (1) -
at
_ exit (1) - attribute (1)
-
attribute
_ alias _ singular (1) -
attribute
_ defaults (1) -
attribute
_ names (1) - attributes (1)
- autorequire (1)
- autorequire= (1)
- before (1)
- bindir (1)
- bindir= (1)
-
cache
_ dir (1) - call (2)
-
cert
_ chain (1) -
cert
_ chain= (1) -
collect
_ specs (1) -
compact
_ specs (1) - conversion (1)
-
count
_ space? (1) - current (1)
- date (1)
- date= (1)
-
decode
_ www _ form (1) -
def
_ builtin _ commands (1) -
def
_ inspector (1) -
default
_ executable (1) -
default
_ executable= (1) -
default
_ external (1) -
default
_ external= (1) -
default
_ internal (1) -
default
_ internal= (1) -
default
_ value (1) -
define
_ finalizer (2) - dependencies (1)
-
dependencies
_ ok? (1) -
dependency
_ order (1) -
dependent
_ gems (1) - description (1)
- description= (1)
-
development
_ dependencies (1) - dir (1)
- download (1)
- email (1)
- email= (1)
-
encode
_ www _ form (1) - encoding (1)
-
ensure
_ dependency (1) - executable (1)
- executable= (1)
- executables (1)
- executables= (1)
- exit (1)
- extensions (1)
- extensions= (1)
-
extra
_ rdoc _ files (1) -
extra
_ rdoc _ files= (1) - fetch (1)
-
fetch
_ spec (1) - fetcher (1)
- fetcher= (1)
-
file
_ name (1) - files (1)
- files= (1)
- find (3)
-
find
_ all (1) -
find
_ matching (1) -
find
_ name (2) -
find
_ reverse _ dependencies (1) -
find
_ spec _ by _ name _ and _ version (1) -
from
_ gems _ in (1) -
from
_ yaml (1) -
full
_ gem _ path (1) -
full
_ name (1) -
gem
_ paths (1) -
gem
_ spec (1) -
gem
_ spec= (1) -
has
_ rdoc (1) -
has
_ rdoc= (1) -
has
_ rdoc? (1) -
has
_ test _ suite? (1) -
has
_ unit _ tests? (1) - homepage (1)
- homepage= (1)
- include? (1)
- init (2)
-
init
_ gemspecs (1) -
inplace
_ mode (1) -
inplace
_ mode= (1) - inspect (55)
- inspect? (1)
-
inspect
_ i (1) -
inspect
_ mode (1) -
inspect
_ mode= (1) -
inspect
_ obj (1) -
inspect
_ sockaddr (1) -
inspect
_ value (1) - install (1)
-
installation
_ path (1) -
installed
_ spec _ directories (1) -
instance
_ eval (2) -
ip
_ pktinfo (2) -
ipv6
_ unspecified? (1) -
irb
/ inspector (1) - it (1)
-
keys
_ with _ inspector (1) - lambda (2)
-
last
_ spec (1) -
last
_ spec _ tried (1) -
latest
_ specs (3) -
legacy
_ repos (1) - letter (1)
-
lib
_ dirs _ for (1) -
lib
_ files (1) - list (2)
- load (1)
-
load
_ gems _ in (1) -
load
_ gemspec (1) -
load
_ gemspecs (1) -
load
_ specification (1) -
load
_ specs (1) - loaded= (1)
- loaded? (1)
-
loaded
_ from (1) -
loaded
_ from= (1) -
mark
_ version (1) - match (1)
- matched (1)
-
matched
_ string (1) -
matching
_ file? (1) -
matching
_ files (1) - member? (1)
-
method
_ inspect (1) -
mid
_ match? (1) -
minitest
/ spec (1) - name (2)
- name= (1)
- new (9)
- normalize (1)
-
normalize
_ yaml _ input (1) -
original
_ name (1) -
original
_ platform (1) -
original
_ platform= (1) -
overwrite
_ accessor (1) -
parse
_ range _ header (1) -
path
_ ok? (1) - pathmap (2)
- platform (1)
- platform= (1)
-
pretty
_ inspect (1) -
pretty
_ print _ inspect (1) -
print
_ dependencies (1) - private (1)
- proc (2)
- protected (1)
- public (1)
-
rake
/ gempackagetask (1) -
rb
_ inspect (1) -
rb
_ obj _ inspect (1) -
rb
_ thread _ inspect (1) -
re
_ string (1) -
read
_ only (1) - remove (1)
-
remove
_ by _ name (1) -
remove
_ executables (1) -
remove
_ spec (1) -
require
_ path (1) -
require
_ path= (1) -
require
_ paths (1) -
require
_ paths= (1) -
required
_ attribute (1) -
required
_ attribute? (1) -
required
_ attributes (1) -
required
_ ruby _ version (1) -
required
_ ruby _ version= (1) -
required
_ rubygems _ version (1) -
required
_ rubygems _ version= (1) - requirements (1)
- requirements= (1)
- rss (1)
-
ruby 1
. 8 . 4 feature (1) - rubygems (1)
-
rubygems
/ commands / contents _ command (1) -
rubygems
/ commands / specification _ command (1) -
rubygems
/ spec _ fetcher (1) -
rubygems
/ specification (1) -
rubygems
_ version (1) -
rubygems
_ version= (1) -
runtime
_ dependencies (1) -
safe
_ level (1) - sanitize (1)
-
satisfies
_ requirement? (1) - scanf (2)
- search (3)
- send (2)
-
signing
_ key (1) -
signing
_ key= (1) -
singleton
_ method _ undefined (1) - spec= (2)
-
spec
_ count (1) -
spec
_ dirs (1) -
spec
_ dirs= (1) -
spec
_ path (1) -
spec
_ predecessors (1) -
special
_ local _ set (1) - specific? (1)
-
specific
_ eval (1) -
specific
_ extra _ args (1) -
specific
_ extra _ args _ hash (1) - specification (1)
-
specification
_ version (1) -
specification
_ version= (1) - specs (2)
- summary (1)
- summary= (1)
-
sync
_ inspect (1) - taint (1)
- tainted? (1)
-
test
_ file (1) -
test
_ file= (1) -
test
_ files (1) -
test
_ files= (1) -
test
_ suite _ file (1) -
test
_ suite _ file= (1) -
to
_ proc (1) -
to
_ re (1) -
to
_ ruby (1) -
to
_ s (18) -
trace
_ var (3) - trap (2)
-
uninstall
_ gem (1) -
unit
_ test (1) - untaint (1)
- validate (1)
- version (1)
- version= (1)
-
warn
_ legacy (1) - width (1)
-
write
_ require _ paths _ file _ if _ needed (1) -
write
_ spec (1) - xmlrpc (1)
- yaml (1)
-
yaml
_ initialize (1) - はじめに (1)
- オブジェクト (1)
- オブジェクト指向スクリプト言語 Ruby リファレンスマニュアル (1)
- クラス (1)
- クラス/メソッドの定義 (1)
- コマンド (1)
- スレッド (1)
- セキュリティモデル (1)
- プログラム・文・式 (1)
- メソッド呼び出し(super・ブロック付き・yield) (1)
- リテラル (1)
- 制御構造 (1)
- 変数と定数 (1)
- 多言語化 (1)
- 字句構造 (1)
- 手続きオブジェクトの挙動の詳細 (1)
- 正規表現 (1)
- 演算子式 (1)
- 環境変数 (1)
- 終了処理 (1)
検索結果
先頭5件
-
static VALUE specific
_ eval(int argc , VALUE *argv , VALUE klass , VALUE self) (78301.0) -
rb_obj_instance_eval と rb_mod_module_eval を共通化するための補助関数です。
rb_obj_instance_eval と rb_mod_module_eval を共通化するための補助関数です。 -
static void special
_ local _ set(char c , VALUE val) (78301.0) -
$~ と $_ をセットします。 現在は c=0 が $_ で c=1 が $~ です。
$~ と $_ をセットします。
現在は c=0 が $_ で c=1 が $~ です。 -
クラス/メソッドの定義 (69163.0)
-
クラス/メソッドの定義 * クラス/メソッドの定義: * class * singleton_class * module * method * operator * nest_method * eval_method * singleton_method * class_method * limit * 定義に関する操作: * alias * undef * defined
クラス/メソッドの定義
* クラス/メソッドの定義:
* class
* singleton_class
* module
* method
* operator
* nest_method
* eval_method
* singleton_method
* class_method
* limit
* 定義に関する操作:
* alias
* undef
* defined
===[a:class] クラス定義
//emlist[例][ruby]{
class Foo < S... -
メソッド呼び出し(super・ブロック付き・yield) (69127.0)
-
メソッド呼び出し(super・ブロック付き・yield) * super * block * yield * block_arg * numbered_parameters * call_method
メソッド呼び出し(super・ブロック付き・yield)
* super
* block
* yield
* block_arg
* numbered_parameters
* call_method
//emlist[例][ruby]{
foo.bar()
foo.bar
bar()
print "hello world\n"
print
Class.new
Class::new
//}
文法:
[式 `.'] 識別子 [`(' [[`*'] 式] ... [`&' 式] `)']
[式 `::'] 識別子 [`(' ... -
プログラム・文・式 (69109.0)
-
プログラム・文・式 * exp * terminate
プログラム・文・式
* exp
* terminate
プログラムはexpを並べたものです。式と式の間はセミコロ
ン(;)または改行で区切ります。ただし、バックスラッシュに続く改行は文
の区切りにならず、次の行へ継続します。
例:
print "hello world!\n"
===[a:exp] 式
例:
true
(1+2)*3
foo()
if test then ok else ng end
Ruby の式には、spec/variables、さまざまなspec/literal... -
制御構造 (69091.0)
-
制御構造 条件分岐: * if * unless * case 繰り返し: * while * until * for * break * next * redo * retry 例外処理: * raise * begin その他: * return * BEGIN * END
制御構造
条件分岐:
* if
* unless
* case
繰り返し:
* while
* until
* for
* break
* next
* redo
* retry
例外処理:
* raise
* begin
その他:
* return
* BEGIN
* END
Rubyでは(Cなどとは異なり)制御構造は式であって、何らかの値を返すものが
あります(返さないものもあります。値を返さない式を代入式の右辺に置くと
syntax error になります)。
R... -
リテラル (69055.0)
-
リテラル * num * string * backslash * exp * char * command * here * regexp * array * hash * range * symbol * percent
リテラル
* num
* string
* backslash
* exp
* char
* command
* here
* regexp
* array
* hash
* range
* symbol
* percent
数字の1や文字列"hello world"のようにRubyのプログラムの中に直接
記述できる値の事をリテラルといいます。
===[a:num] 数値リテラル
: 123
: 0d123
整数
: -123
符号つき整数
: 123.45
浮動小数点数。
.1 など "." で始まる浮動小... -
コマンド (69037.0)
-
コマンド Ruby では以下のコマンドが提供されます。
コマンド
Ruby では以下のコマンドが提供されます。
: erb
埋め込みRuby処理ツール。erb を参照。
: gem
Rubyのパッケージ管理ツール。lib:rubygems#gem_command を参照。
: irb
Ruby の対話インタフェース。irb を参照。
: rake
Ruby の内部 DSL で記述するビルドツール。rake を参照。
: rdoc
Ruby のソースファイルからドキュメントを生成するツール。rdoc を参照。
: ri
RDoc で書かれた Ruby のドキュメントをコマンドラインから閲覧するツール。
: ruby
R... -
スレッド (69037.0)
-
スレッド スレッドとはメモリ空間を共有して同時に実行される制御の流れです。 Ruby ではスレッドはThread クラスのインスタンスとして表されます。
スレッド
スレッドとはメモリ空間を共有して同時に実行される制御の流れです。
Ruby ではスレッドはThread クラスのインスタンスとして表されます。
=== 実装
ネイティブスレッドを用いて実装されていますが、
現在の実装では Ruby VM は Giant VM lock (GVL) を有しており、同時に実行される
ネイティブスレッドは常にひとつです。
ただし、IO 関連のブロックする可能性があるシステムコールを行う場合には
GVL を解放します。その場合にはスレッドは同時に実行され得ます。
また拡張ライブラリから GVL を操作できるので、複数のスレッドを
同時に実行するような拡... -
正規表現 (69037.0)
-
正規表現 * metachar * expansion * char * anychar * string * str * quantifier * capture * grouping * subexp * selector * anchor * cond * option * encoding * comment * free_format_mode * absenceop * list * specialvar * references
正規表現
* metachar
* expansion
* char
* anychar
* string
* str
* quantifier
* capture
* grouping
* subexp
* selector
* anchor
* cond
* option
* encoding
* comment
* free_format_mode
* absenceop
* list
* specialvar
* references
正規表現(regular expression)は文字列のパタ... -
Ruby プログラムの実行 (69019.0)
-
Ruby プログラムの実行 === Ruby プログラム
Ruby プログラムの実行
=== Ruby プログラム
Ruby プログラムの実行は文の連なりの評価です。なんらかの形であたえられたプログラムテキストをコンパイルし、BEGIN 文があればそれを評価し、トップレベルの式の連なりを評価し、END ブロックがあれば最後にそれを評価して終了します (終了処理の詳細については spec/terminate を参照のこと)。
=== 文
==== if
if 文は、まず条件式を評価し、その値が真ならば対応する本体を評価します。
偽ならば elsif 節の条件式を順番に評価し、その値が始めて真になった節の
本体を評価します。それらがすべて偽なら... -
手続きオブジェクトの挙動の詳細 (69019.0)
-
手続きオブジェクトの挙動の詳細 * def * should_use_next * block * lambda_proc * orphan
手続きオブジェクトの挙動の詳細
* def
* should_use_next
* block
* lambda_proc
* orphan
===[a:def] 手続きオブジェクトとは
手続きオブジェクトとはブロックをコンテキスト(ローカル変数のスコープやスタックフレーム)と
ともにオブジェクトにしたものです。Proc クラスのインスタンスとして実現されています。
ブロック内では、新たなスコープが導入されるとともに、外側のローカル変数を参照できます。
Proc オブジェクトがローカル変数のスコープを保持していることは以下の例で変数 var を
参照できていることからわかりま... -
演算子式 (69019.0)
-
演算子式 * assign * selfassign * multiassign * range * range_cond * and * or * not * cond
演算子式
* assign
* selfassign
* multiassign
* range
* range_cond
* and
* or
* not
* cond
//emlist[例][ruby]{
1+2*3/4
//}
プログラミングの利便のために一部のメソッド呼び出しと制御構造は演算子形
式をとります。Rubyには以下にあげる演算子があります。
高い ::
[]
+(単項) ! ~
**
... -
環境変数 (69019.0)
-
環境変数 Rubyインタプリタは以下の環境変数を参照します。
環境変数
Rubyインタプリタは以下の環境変数を参照します。
: RUBYOPT
Rubyインタプリタにデフォルトで渡すオプションを指定します。
指定できないオプションを指定した場合、例外が発生します。
//emlist{
$ RUBYOPT=-y ruby -e ""
ruby: invalid switch in RUBYOPT: -y (RuntimeError)
//}
sh系
//emlist{
RUBYOPT='-Ke -rkconv'
export RUBYOPT
//}
csh系
//emlist{
setenv RU... -
終了処理 (69019.0)
-
終了処理 Ruby はスクリプトの終端に達した場合や捕捉していない例外が発生した場 合に終了します(関数 Kernel.#exit や Kernel.#abort 、メインスレッドに対する Thread.kill などは SystemExit 例外を発生させます)。終了時には以下 の処理が順に実行されます。
終了処理
Ruby はスクリプトの終端に達した場合や捕捉していない例外が発生した場
合に終了します(関数 Kernel.#exit や Kernel.#abort
、メインスレッドに対する Thread.kill などは
SystemExit 例外を発生させます)。終了時には以下
の処理が順に実行されます。
(1) すべてのスレッドを Thread.kill する。
(1) Ruby の擬似シグナル SIGEXIT のハンドラが登録されていればそれを実
行する(Kernel.#trap を参照)。
(1) d:spec/control#END ブロック(END { ... -
Rubyの起動 (69001.0)
-
Rubyの起動 * cmd_option * shebang
Rubyの起動
* cmd_option
* shebang
Rubyインタプリタの起動は以下の書式のコマンドラインにより行います。
ruby [ option ...] [ -- ] [ programfile ] [ argument ...]
ここで、option は後述のcmd_option
のいずれかを指定します。-- は、オプション列の終りを明示するため
に使用できます。programfile は、Ruby スクリプトを記述したファイ
ルです。これを省略したり`-' を指定した場合には標準入力を Ruby ス
クリプトとみなします。
programfile が... -
はじめに (69001.0)
-
はじめに Rubyは手軽なオブジェクト指向プログラミングのためのインタプリタ言語です。 Rubyは(Perlのような)テキスト処理やシステム管理のための豊富な機能を持っています。 また、Rubyは単純で、分かりやすく、簡単に拡張できます。
はじめに
Rubyは手軽なオブジェクト指向プログラミングのためのインタプリタ言語です。
Rubyは(Perlのような)テキスト処理やシステム管理のための豊富な機能を持っています。
また、Rubyは単純で、分かりやすく、簡単に拡張できます。
もし、簡単なオブジェクト指向のための言語を求めていたり、
Perlは見にくいと感じていたり、
Lispの考え方は好きだがあの括弧の多さには困ると感じているなら、
Rubyはまさにぴったりです。
Rubyの特長は次の通りです。
: インタプリタ
Rubyはインタプリタ言語ですので
プログラムを実行するためにコンパイルする必要はありませ... -
オブジェクト (69001.0)
-
オブジェクト === オブジェクトとは
オブジェクト
=== オブジェクトとは
Ruby で扱える全ての値はオブジェクトです。
Ruby のオブジェクトに対して可能な操作はメソッド呼び出しのみです。
あるオブジェクトが反応できるメソッドは、
そのオブジェクトが所属するクラスによって一意に決定します。
所属するクラスはオブジェクト生成時に決まり、その後は特異クラスの導入以外、所属クラスが変わることはありません。
またオブジェクトは、特定のクラスに対比して、その「インスタンス」とも呼ばれます。
オブジェクトの生成は、一般には、別のオブジェクトのメソッドを呼び出すことによって行われます。
=== クラス
クラスは自身に所属するオ... -
クラス (69001.0)
-
クラス === クラスとオブジェクト
クラス
=== クラスとオブジェクト
Ruby プログラムからはクラスもまたオブジェクトとして扱うことが
でき、文による操作と合わせると以下の基本操作が可能です。
* メソッドの存在を問い合わせる
* メソッドを定義する
* メソッドの定義を取り消す
=== モジュール
=== 特異クラス -
セキュリティモデル (69001.0)
-
セキュリティモデル RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ 機構が備わっています。
セキュリティモデル
RubyにはCGI等のプログラミングを安全に行うことを助ける為に、セキュリティ
機構が備わっています。
Rubyのセキュリティモデルは「オブジェクトの汚染」と「セーフレベル」という
仕組みによってなりたっています。
=== オブジェクトの汚染
Rubyではオブジェクトは「汚染されている」とみなされることがあります。この
しくみは大きく分けて二つの使われ方をします。
ひとつ目は、信用できない入力をもとに作られたオブジェクトを「汚染されてい
る」とみなし、「危険な操作」の引数として使えないようにすることです。悪意
あるデータによって、プログラムが意図しない動作をする事... -
変数と定数 (69001.0)
-
変数と定数 * local * instance * class * class_var_scope * global * pseudo * const * prio
変数と定数
* local
* instance
* class
* class_var_scope
* global
* pseudo
* const
* prio
Ruby の変数と定数の種別は変数名の最初の一文字によって、
ローカル変数、
インスタンス変数、
クラス変数、
グローバル変数、
定数
のいずれかに区別されます。
通常の変数の二文字目以降は英数字または
_ですが、組み込み変数の一部には
「`$'+1文字の記号」という変数があります(builtinを参照)。変数名
の長さにはメモリのサイズ以外の制限はありません。
===[a:local] ロ... -
多言語化 (69001.0)
-
多言語化 Ruby は US-ASCII はもちろん、US-ASCII 以外の文字エンコーディングもサポートしています。 文字列の内部表現のエンコーディングは固定されておらず、 プログラマは目的に応じて使用するエンコーディングを選ぶことができます。
多言語化
Ruby は US-ASCII はもちろん、US-ASCII 以外の文字エンコーディングもサポートしています。
文字列の内部表現のエンコーディングは固定されておらず、
プログラマは目的に応じて使用するエンコーディングを選ぶことができます。
同じプロセスの中で異なるエンコーディングの文字列が同時に存在することができます。
全ての String や Regexp などのオブジェクトは自身のエンコーディング情報を保持しています。
これにより各オブジェクト内の文字を適切に取り扱うことができます。
後述のマジックコメントでスクリプトエンコーディングを指定すると、
Ruby スクリプトに非... -
字句構造 (69001.0)
-
字句構造 * identifier * comment * embed * reserved
字句構造
* identifier
* comment
* embed
* reserved
Rubyの現在の実装はASCIIキャラクタセットを用いています。アル
ファベットの大文字と小文字は区別されます。識別子と一部のリテ
ラルの途中を除いては任意の場所に空白文字やコメントを置くこと
ができます。空白文字とはスペース、タブ、垂直タブ、バックスペー
ス、キャリッジリターン、ラインフィード、改ページです。改行は行が明らかに次の
行に継続する時だけ、空白文字として、それ以外では文の区切りと
して解釈されます。
改行と認識されるのは、キャリッジリターン+ラインフィードかラインフ... -
Gem
:: Format # spec -> Gem :: Specification (54604.0) -
Gem の Gem::Specification を返します。
Gem の Gem::Specification を返します。 -
Gem
:: Installer # spec -> Gem :: Specification (54604.0) -
インストールしようとしている Gem に対応する Gem::Specification のインスタンスを返します。
インストールしようとしている Gem に対応する Gem::Specification のインスタンスを返します。 -
Gem
:: OldFormat # spec -> Gem :: Specification (54604.0) -
Gem の Gem::Specification を返します。
Gem の Gem::Specification を返します。 -
Gem
:: Uninstaller # spec -> Gem :: Specification (54604.0) -
Gem::Uninstaller#uninstall_gem の実行中のみセットされます。
Gem::Uninstaller#uninstall_gem の実行中のみセットされます。 -
Gem
:: SpecFetcher # fetch _ spec(spec , source _ uri) -> object (27625.0) -
@todo
@todo
@param spec
@param source_uri -
IRB
:: Inspector . keys _ with _ inspector(inspector) -> Array (27601.0) -
引数で指定した IRB::Inspector に対応する key の配列を返します。
引数で指定した IRB::Inspector に対応する key の配列を返します。
@param inspector IRB::Inspector オブジェクトを指定します。
IRB::Inspector.keys_with_inspector(IRB::Inspector::INSPECTORS[true])
# => [true, :p, "p", :inspect, "inspect"] -
Gem
:: SpecFetcher # latest _ specs -> Hash (27301.0) -
キャッシュされている最新の gemspec を返します。
キャッシュされている最新の gemspec を返します。 -
Gem
:: SpecFetcher # load _ specs(source _ uri , file) -> object (27301.0) -
指定された source_uri, file から gemspec をロードします。
指定された source_uri, file から gemspec をロードします。
また、内部ではキャッシュの更新も行っています。
@param source_uri gemspec の置いてある URI を指定します。
@param file gemspec のファイル名を指定します。 -
Gem
:: SpecFetcher # specs -> Hash (27301.0) -
キャッシュされている全ての gemspec を返します。
キャッシュされている全ての gemspec を返します。 -
Gem
:: Specification # specification _ version -> Integer (27301.0) -
この Gem パッケージに用いられている gemspec のバージョンを返します。
この Gem パッケージに用いられている gemspec のバージョンを返します。 -
Gem
:: Specification # specification _ version=(version) (27301.0) -
この Gem パッケージに用いられている gemspec のバージョンをセットします。
この Gem パッケージに用いられている gemspec のバージョンをセットします。
@param version gemspec のバージョンを指定します。
@see Gem::Specification::SPECIFICATION_VERSION_HISTORY -
Gem
:: Specification :: CURRENT _ SPECIFICATION _ VERSION -> 2 (27301.0) -
現在の gemspec のバージョンを表す定数です。
現在の gemspec のバージョンを表す定数です。 -
Gem
:: Specification :: NONEXISTENT _ SPECIFICATION _ VERSION -> -1 (27301.0) -
明確に指定されていない時の gemspec のバージョンを表します。
明確に指定されていない時の gemspec のバージョンを表します。 -
Gem
:: Specification :: SPECIFICATION _ VERSION _ HISTORY -> Hash (27301.0) -
gemspec ファイルのバージョンの歴史を表す定数です。
gemspec ファイルのバージョンの歴史を表す定数です。 -
IRB
:: Inspector # inspect _ value(v) -> () (27301.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。 -
IRB
:: Inspector . def _ inspector(key , arg = nil) { |v| . . . } -> object (27301.0) -
新しい実行結果の出力方式を定義します。
新しい実行結果の出力方式を定義します。
@param key conf.inspect_mode や IRB.conf[:INSPECT_MODE] に指定するキー
オブジェクトを指定します。配列を指定した場合は配列中の要素全
てが対象になります。
@param arg ブロックを指定する場合には、inspect_mode の初期化のための手続
きオブジェクトを指定します。あらかじめ require が必要な場合
などに、proc { require "foo" } といった指定を行います。
... -
IRB
:: Inspector :: INSPECTORS (27001.0) -
定義された inspect_mode を管理する Hash オブジェクトです。
定義された inspect_mode を管理する Hash オブジェクトです。
デフォルトで扱える Inspector については lib:irb#inspect_mode を
参照してください。 -
Gem
:: SourceIndex # add _ spec(gem _ spec) -> Gem :: Specification (18925.0) -
自身に引数で与えられた Gem::Specification のインスタンスを追加します。
自身に引数で与えられた Gem::Specification のインスタンスを追加します。
@param gem_spec Gem::Specification のインスタンスを指定します。 -
IRB
. Inspector(inspect , init = nil) -> IRB :: Inspector (18901.0) -
IRB::Inspector オブジェクトを生成します。
IRB::Inspector オブジェクトを生成します。
@param inspect 実行結果の出力のための手続きオブジェクトを指定します。
@param init inspect_mode の初期化のための手続きオブジェクトを指定します。
あらかじめ require が必要な場合などに、proc { require "foo" }
といった指定を行います。 -
Gem
:: Format # spec=(spec) (18625.0) -
Gem の Gem::Specification をセットします。
Gem の Gem::Specification をセットします。
@param spec Gem の Gem::Specification をセットします。 -
Gem
:: OldFormat # spec=(spec) (18625.0) -
Gem の Gem::Specification をセットします。
Gem の Gem::Specification をセットします。
@param spec Gem の Gem::Specification をセットします。 -
Rake
:: GemPackageTask # gem _ spec=(gem _ spec) (18625.0) -
gemspec をセットします。
gemspec をセットします。
@param gem_spec Gem::Specification のインスタンスを指定します。 -
Gem
:: SourceIndex # remove _ spec(full _ name) -> Gem :: Specification (18604.0) -
引数で指定された名前を持つ Gem をインデックスから削除します。
引数で指定された名前を持つ Gem をインデックスから削除します。 -
Rake
:: GemPackageTask # gem _ spec -> Gem :: Specification (18604.0) -
package ターゲットで使用する gemspec を返します。
package ターゲットで使用する gemspec を返します。
gemspec にはパッケージ名、バージョン、パッケージに含まれるファイルなどが定義
されているので、それらを明示的に指定する必要はありません。 -
Gem
:: GemPathSearcher # init _ gemspecs -> [Gem :: Specification] (18601.0) -
インストール済みの Gem の Gem::Specification のリストを返します。
インストール済みの Gem の Gem::Specification のリストを返します。
リストはアルファベット順かつバージョンの新しい順にソートされています。 -
Gem
:: Indexer # compact _ specs(specs) -> Array (18601.0) -
与えられたスペックを元にスペックを一意に特定できるだけの情報を持った配列を作成して 返します。
与えられたスペックを元にスペックを一意に特定できるだけの情報を持った配列を作成して
返します。
@param specs Gem::Specification の配列を指定します。 -
Gem
:: Package :: TarInput # load _ gemspec(io) -> Gem :: Specification | nil (18601.0) -
YAML 形式の gemspec を io から読み込みます。
YAML 形式の gemspec を io から読み込みます。
@param io 文字列か IO オブジェクトを指定します。
@see Gem::Specification.from_yaml -
Gem
:: SourceIndex # add _ specs(*gem _ specs) -> Hash (18601.0) -
自身に引数で与えられた Gem::Specification のインスタンスを全て追加します。
自身に引数で与えられた Gem::Specification のインスタンスを全て追加します。
@param gem_specs 複数の Gem::Specification のインスタンスを指定します。 -
Gem
:: SourceIndex # specification(full _ name) -> Gem :: Specification | nil (18601.0) -
指定された名前の Gem::Specification オブジェクトを返します。
指定された名前の Gem::Specification オブジェクトを返します。
@param full_name Gem のフルネームを指定します。 -
Gem
:: SourceIndex . load _ specification(file _ name) -> Gem :: Specification | nil (18601.0) -
与えられたファイル名から Ruby スクリプト形式の gemspec をロードして Gem::Specification のインスタンスを返します。
与えられたファイル名から Ruby スクリプト形式の gemspec をロードして
Gem::Specification のインスタンスを返します。
@param file_name ファイル名を指定します。
@raise SignalException gemspec をロードしているときに発生します。
@raise SystemExit gemspec をロードしているときに発生します。 -
OpenStruct
:: InspectKey -> : _ _ inspect _ key _ _ (18601.0) -
内部的に使用する定数です。
内部的に使用する定数です。 -
Gem
:: DependencyList # spec _ predecessors -> Hash (18340.0) -
@todo ???
@todo ???
Return a hash of predecessors. <tt>result[spec]</tt> is an
Array of gemspecs that have a dependency satisfied by the named
spec. -
Gem
:: Commands :: LockCommand # spec _ path(gem _ full _ name) -> String (18304.0) -
指定された Gem パッケージの gemspec ファイルのフルパスを返します。
指定された Gem パッケージの gemspec ファイルのフルパスを返します。
@param gem_full_name Gem パッケージの名前を指定します。 -
Gem
:: DependencyInstaller # find _ spec _ by _ name _ and _ version(gem _ name , version = Gem :: Requirement . default) -> Array (18304.0) -
与えられた Gem の名前とバージョンに関する条件にマッチする Gem::Specification と それの存在する URI を含む配列を返します。
与えられた Gem の名前とバージョンに関する条件にマッチする Gem::Specification と
それの存在する URI を含む配列を返します。
@param gem_name Gem の名前を指定します。
@param version Gem が満たすバージョンに関する条件を指定します。 -
Gem
:: Installer # write _ spec (18304.0) -
Ruby スクリプト形式で .gemspec ファイルを作成します。
Ruby スクリプト形式で .gemspec ファイルを作成します。 -
Gem
:: SourceIndex # spec _ dirs -> [String] (18304.0) -
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを取得します。
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを取得します。 -
Gem
:: SourceIndex # spec _ dirs=(dirs) (18304.0) -
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを設定します。
Gem::SourceIndex#refresh! で自身を更新する時に使用するディレクトリを設定します。 -
Gem
:: SourceIndex . installed _ spec _ directories -> [String] (18304.0) -
gemspec ファイルがインストールされているディレクトリのリストを返します。
gemspec ファイルがインストールされているディレクトリのリストを返します。
@see Gem.#path -
IRB
:: MagicFile . ENCODING _ SPEC _ RE -> %r"coding\s*[=:]\s*([[:alnum:]\- _ ]+)" (18304.0) -
マジックコメントにマッチする正規表現を返します。
マジックコメントにマッチする正規表現を返します。 -
Scanf
:: FormatString # last _ spec (18304.0) -
@todo
@todo -
Scanf
:: FormatString # last _ spec _ tried (18304.0) -
@todo
@todo -
Scanf
:: FormatString # spec _ count (18304.0) -
@todo
@todo -
ARGF
. class # inspect -> String (18301.0) -
常に文字列 "ARGF" を返します。
常に文字列 "ARGF" を返します。 -
Addrinfo
# inspect _ sockaddr -> String (18301.0) -
アドレスやポート番号などの情報を人間に読める形の文字列で返します。
アドレスやポート番号などの情報を人間に読める形の文字列で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).inspect_sockaddr #=> "127.0.0.1:80"
Addrinfo.tcp("ip6-localhost", 80).inspect_sockaddr #=> "[::1]:80"
Addrinfo.unix("/tmp/sock").inspect_sockaddr #=> "/tmp/sock" -
Addrinfo
# ipv6 _ unspecified? -> bool (18301.0) -
IPv6 の不特定アドレス(unspecified address)(::)であれば真を返します。
IPv6 の不特定アドレス(unspecified address)(::)であれば真を返します。 -
Array
# inspect -> String (18301.0) -
自身の情報を人間に読みやすい文字列にして返します。
自身の情報を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
[1, 2, 3, 4].to_s # => "[1, 2, 3, 4]"
[1, 2, 3, 4].inspect # => "[1, 2, 3, 4]"
//} -
BigDecimal
# inspect -> String (18301.0) -
BigDecimal オブジェクトを表す文字列を返します。
BigDecimal オブジェクトを表す文字列を返します。
//emlist[][ruby]{
require "bigdecimal"
BigDecimal("1234.5678").inspect
# => "0.12345678e4"
//} -
Bignum
# inspect(base = 10) -> String (18301.0) -
self を引数で指定した基数の文字列表現に変換します。
self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345654321.to_s #=> "12345654321"
12345654321.to_s(2) #=> "1011011111110110111011110000110001"
12345654321.to_s(8) #=> "133766736061"
12345654321.to_s(16) #=> "2dfdbbc31"
78546939656932.to_s(36) ... -
CSV
# inspect -> String (18301.0) -
ASCII 互換文字列で自身の情報を表したものを返します。
ASCII 互換文字列で自身の情報を表したものを返します。
//emlist[例][ruby]{
require "csv"
csv = CSV.new("header1,header2\nrow1_1,row1_2")
csv.inspect # => "<#CSV io_type:StringIO encoding:UTF-8 lineno:0 col_sep:\",\" row_sep:\"\\n\" quote_char:\"\\\"\">"
//} -
CSV
:: Row # inspect -> String (18301.0) -
ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
ASCII 互換であるエンコーディングの文字列で自身の情報を返します。
//emlist[例][ruby]{
require "csv"
row = CSV::Row.new(["header1", "header2", "header1"], [1, 2, 3])
row.inspect # => "#<CSV::Row \"header1\":1 \"header2\":2 \"header1\":3>"
//} -
CSV
:: Table # inspect -> String (18301.0) -
モードとサイズを US-ASCII な文字列で返します。
モードとサイズを US-ASCII な文字列で返します。
//emlist[][ruby]{
require 'csv'
csv = CSV.new("a,b,c\n1,2,3", headers: true)
table = csv.read
p table.inspect # => "#<CSV::Table mode:col_or_row row_count:2>"
//} -
Complex
# inspect -> String (18301.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
//emlist[例][ruby]{
Complex(2).inspect # => "(2+0i)"
Complex('-8/6').inspect # => "((-4/3)+0i)"
Complex('1/2i').inspect # => "(0+(1/2)*i)"
Complex(0, Float::INFINITY).inspect # => "(0+Infinity*i)"
Complex(Float:... -
Dir
# inspect -> String (18301.0) -
self の情報を人間に読みやすい文字列にして返します。
self の情報を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
Dir.open("/") { |d| d.inspect } # => "#<Dir:/>"
//} -
ENV
. inspect -> String (18301.0) -
ENV オブジェクトを文字列化します。 Hash#inspect と同じように動作します。
ENV オブジェクトを文字列化します。 Hash#inspect と同じように動作します。 -
Encoding
# inspect -> String (18301.0) -
プログラマにわかりやすい表現の文字列を返します。
プログラマにわかりやすい表現の文字列を返します。
//emlist[例][ruby]{
Encoding::UTF_8.inspect #=> "#<Encoding:UTF-8>"
Encoding::ISO_2022_JP.inspect #=> "#<Encoding:ISO-2022-JP (dummy)>"
//} -
Encoding
:: Converter # inspect -> String (18301.0) -
Encoding::Converter オブジェクトの情報を簡単に表示します。
Encoding::Converter オブジェクトの情報を簡単に表示します。
@return 変換器の情報を簡単に可視化した文字列です。 -
Exception
# inspect -> String (18301.0) -
self のクラス名と message を文字列にして返します。
self のクラス名と message を文字列にして返します。
//emlist[例][ruby]{
begin
raise "exception"
rescue
p $!.inspect # => "#<RuntimeError: exception>"
end
//} -
FalseClass
# inspect -> String (18301.0) -
常に文字列 "false" を返します。
常に文字列 "false" を返します。
//emlist[例][ruby]{
false.to_s # => "false"
//} -
Fixnum
# inspect(base = 10) -> String (18301.0) -
self を引数で指定した基数の文字列表現に変換します。
self を引数で指定した基数の文字列表現に変換します。
@param base 基数を 2 から 36 の整数で指定します。
12345.to_s #=> "12345"
12345.to_s(2) #=> "11000000111001"
12345.to_s(8) #=> "30071"
12345.to_s(10) #=> "12345"
12345.to_s(16) #=> "3039"
12345.to_s(36) #=> "9ix" -
Float
# inspect -> String (18301.0) -
自身を人間が読みやすい形の文字列表現にして返します。
自身を人間が読みやすい形の文字列表現にして返します。
固定小数点、浮動小数点の形式か、 "Infinity"、"-Infinity"、"NaN" のいず
れかを返します。
@return 文字列を返します。
//emlist[例][ruby]{
0.00001.to_s # => "1.0e-05"
3.14.to_s # => "3.14"
10000_00000_00000.0.to_s # => "100000000000000.0"
10000_00000_00000_00000.0.to_s # => "1.0e+19"
... -
Gem
:: Command . add _ specific _ extra _ args(cmd , args) (18301.0) -
与えられたコマンドに対応する追加の引数を追加します。
与えられたコマンドに対応する追加の引数を追加します。
@param cmd コマンド名を指定します。
@param args 追加の引数を配列か、空白で区切った文字列で指定します。 -
Gem
:: Command . specific _ extra _ args(cmd) -> Array (18301.0) -
与えられたコマンドに対応する追加の引数を返します。
与えられたコマンドに対応する追加の引数を返します。
特別な追加引数はプログラムの開始時に Gem の設定ファイルから読み込まれます。
@param cmd コマンド名を指定します。 -
Gem
:: Command . specific _ extra _ args _ hash -> Hash (18301.0) -
特別な追加引数へのアクセスを提供します。
特別な追加引数へのアクセスを提供します。 -
Gem
:: Commands :: BuildCommand # load _ gemspecs(filename) -> Array (18301.0) -
gemspec ファイルをロードします。
gemspec ファイルをロードします。
@param filename ファイル名を指定します。 -
Gem
:: Indexer # collect _ specs -> Gem :: SourceIndex (18301.0) -
Gem のキャッシュディレクトリ内の *.gem ファイルから Gem::Specification を集めます。
Gem のキャッシュディレクトリ内の *.gem ファイルから Gem::Specification を集めます。 -
Gem
:: Requirement # specific? -> bool (18301.0) -
条件に上限のある指定で、最新のバージョンにマッチしない可能性のある場合は、true を返します。
条件に上限のある指定で、最新のバージョンにマッチしない可能性のある場合は、true を返します。
//emlist[][ruby]{
p Gem::Requirement.new(">= 3").specific? # => false
p Gem::Requirement.new("~> 3").specific? # => true
p Gem::Requirement.new("= 3").specific? # => true
//} -
Gem
:: Server # latest _ specs(request , response) -> () (18301.0) -
メソッド名に対応する URI に対するリクエストを処理するメソッドです。
メソッド名に対応する URI に対するリクエストを処理するメソッドです。
@param request WEBrick::HTTPRequest オブジェクトが自動的に指定されます。
@param response WEBrick::HTTPResponse オブジェクトが自動的に指定されます。 -
Gem
:: Server # specs(request , response) -> () (18301.0) -
メソッド名に対応する URI に対するリクエストを処理するメソッドです。
メソッド名に対応する URI に対するリクエストを処理するメソッドです。
@param request WEBrick::HTTPRequest オブジェクトが自動的に指定されます。
@param response WEBrick::HTTPResponse オブジェクトが自動的に指定されます。 -
Gem
:: SourceIndex # latest _ specs -> Array (18301.0) -
自身に含まれる最新の Gem::Specification のリストを返します。
自身に含まれる最新の Gem::Specification のリストを返します。 -
Hash
# inspect -> String (18301.0) -
ハッシュの内容を人間に読みやすい文字列にして返します。
ハッシュの内容を人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
h = { "c" => 300, "a" => 100, "d" => 400 }
h.inspect # => "{\"c\"=>300, \"a\"=>100, \"d\"=>400}"
//} -
IPAddr
# inspect -> String (18301.0) -
オブジェクトを人間が読める形式に変換した文字列を返します。
オブジェクトを人間が読める形式に変換した文字列を返します。 -
IRB
:: Context # _ _ inspect _ _ -> String (18301.0) -
自身を文字列表現にしたオブジェクトを返します。
自身を文字列表現にしたオブジェクトを返します。 -
IRB
:: Context # inspect -> String (18301.0) -
自身を人間に読みやすい文字列にして返します。
自身を人間に読みやすい文字列にして返します。 -
IRB
:: Context # inspect? -> bool (18301.0) -
IRB::Context#inspect_mode が有効かどうかを返します。
IRB::Context#inspect_mode が有効かどうかを返します。
@return 出力結果に to_s したものを表示する場合は false を返します。それ
以外の場合は true を返します。
@see IRB::Context#inspect_mode, IRB::Context#inspect_mode= -
IRB
:: Context # inspect _ mode -> object | nil (18301.0) -
実行結果の出力方式を返します。
実行結果の出力方式を返します。
@see IRB::Context#inspect_mode= -
IRB
:: Context # inspect _ mode=(opt) (18301.0) -
実行結果の出力方式を opt に設定します。
実行結果の出力方式を opt に設定します。
@param opt 以下のいずれかを指定します。
: false, :to_s, :raw
出力結果を to_s したものを表示します。
: true, :p, :inspect
出力結果を inspect したものを表示します。
: :pp, :pretty_inspect
出力結果を pretty_inspect したものを表示します。
: :yaml, :YAML
出力結果を YAML 形式にしたものを表示します。
: :marshal, :Marshal, :MARSHAL, Marshal
出力結果を Marsh... -
IRB
:: Context :: NO _ INSPECTING _ IVARS -> [String] (18301.0) -
ライブラリ内部で使用します。
ライブラリ内部で使用します。