別のキーワード
ライブラリ
- ビルトイン (92)
- bigdecimal (1)
-
cgi
/ core (3) - date (7)
- fiddle (2)
-
fiddle
/ import (4) - ipaddr (1)
-
irb
/ ext / history (1) -
irb
/ ext / save-history (1) - mkmf (10)
-
net
/ ftp (2) -
net
/ http (4) -
net
/ imap (9) -
net
/ pop (1) - openssl (24)
- optparse (1)
- pathname (1)
- pp (4)
- prettyprint (12)
- psych (13)
- resolv (2)
-
rexml
/ document (1) -
rinda
/ tuplespace (1) -
ripper
/ lexer (2) -
rubygems
/ commands / dependency _ command (1) -
rubygems
/ dependency (1) -
rubygems
/ package / tar _ reader / entry (2) -
rubygems
/ requirement (1) -
rubygems
/ source _ info _ cache _ entry (1) -
rubygems
/ user _ interaction (3) -
shell
/ system-command (1) - socket (15)
- stringio (4)
- sync (1)
-
syslog
/ logger (1) - win32ole (9)
- zlib (2)
クラス
-
ARGF
. class (2) - Addrinfo (3)
- Array (54)
- BasicSocket (2)
- BigDecimal (1)
- Date (7)
- Enumerator (1)
-
Fiddle
:: Closure (1) -
Fiddle
:: Handle (1) -
Gem
:: Commands :: DependencyCommand (1) -
Gem
:: Dependency (1) -
Gem
:: Package :: TarReader :: Entry (2) -
Gem
:: Requirement (1) -
Gem
:: SourceInfoCacheEntry (1) - IO (4)
- IPAddr (1)
-
IRB
:: Context (2) - Method (1)
-
Net
:: FTP :: MLSxEntry (2) -
Net
:: HTTP (4) -
Net
:: IMAP (4) -
Net
:: IMAP :: BodyTypeBasic (1) -
Net
:: IMAP :: BodyTypeMessage (2) -
Net
:: IMAP :: BodyTypeText (2) -
Net
:: POP3 (1) - Object (4)
-
OpenSSL
:: BN (2) -
OpenSSL
:: Cipher (1) -
OpenSSL
:: OCSP :: BasicResponse (1) -
OpenSSL
:: PKey :: EC (1) -
OpenSSL
:: PKey :: EC :: Group (5) -
OpenSSL
:: PKey :: EC :: Point (9) -
OpenSSL
:: SSL :: SSLContext (3) -
OpenSSL
:: SSL :: SSLSocket (2) - OptionParser (1)
- Pathname (1)
- PrettyPrint (12)
- Proc (2)
-
Psych
:: Emitter (2) -
Psych
:: Nodes :: Document (1) -
Psych
:: Nodes :: Mapping (1) -
Psych
:: Nodes :: Scalar (1) -
Psych
:: Nodes :: Sequence (1) -
Psych
:: Nodes :: Stream (1) -
Psych
:: Parser :: Mark (3) -
Psych
:: SyntaxError (3) -
REXML
:: Formatters :: Pretty (1) - Range (1)
-
Resolv
:: DNS :: Resource :: IN :: SRV (1) -
Resolv
:: DNS :: Resource :: SOA (1) -
Rinda
:: TupleEntry (1) -
Ripper
:: Lexer (2) -
RubyVM
:: InstructionSequence (2) -
Shell
:: SystemCommand (1) -
Socket
:: AncillaryData (7) -
Socket
:: Option (1) - String (7)
- StringIO (4)
- Symbol (6)
-
Syslog
:: Logger (1) - SystemCallError (1)
- SystemExit (1)
- TCPServer (1)
- Thread (1)
- Time (5)
- TracePoint (3)
- UNIXServer (1)
- UnboundMethod (1)
- WIN32OLE (1)
-
WIN32OLE
_ METHOD (1) -
WIN32OLE
_ TYPE (4) -
WIN32OLE
_ TYPELIB (2) -
WIN32OLE
_ VARIANT (1) -
Zlib
:: Inflate (1) -
Zlib
:: ZStream (1)
モジュール
-
CGI
:: QueryExtension (3) -
Fiddle
:: Importer (4) -
Gem
:: UserInteraction (3) - Kernel (10)
-
Sync
_ m (1)
キーワード
- * (2)
- <=> (1)
- == (1)
- =~ (1)
- [] (3)
- []= (3)
- afamily (1)
- arity (3)
-
ask
_ yes _ no (1) -
asn1
_ flag (1) - at (1)
- bind (1)
- breakable (2)
-
bsearch
_ index (1) - bytes (1)
-
bytes
_ read (1) - bytesize (1)
-
callee
_ id (1) -
check
_ signedness (2) -
check
_ sizeof (2) -
choose
_ from _ list (1) - column (2)
- combination (2)
-
content
_ length (1) -
convertible
_ int (2) -
copy
_ nonce (1) - count (3)
-
create
_ value (1) - ctype (1)
- cwday (1)
- cwyear (1)
- cycle (2)
-
data
_ type (1) - day (2)
- degree (1)
-
delete
_ at (1) - encoding (1)
- eql? (1)
- errno (1)
-
eval
_ history (1) - event (1)
- facts (1)
- family (3)
- fetch (3)
-
find
_ index (2) - first (2)
-
first
_ lineno (1) - flatten (1)
- flatten! (1)
- flush (1)
-
gateway
_ interface (1) - generator (1)
- genspace (1)
- getbyte (4)
- group (2)
- hash (2)
- helpcontext (1)
-
import
_ symbol (1) - indent (1)
- indentation (1)
- index (3)
- infinity? (1)
- insert (1)
- intern (2)
- invert! (1)
-
ip
_ pktinfo (1) -
ipv6
_ pktinfo (1) -
ipv6
_ pktinfo _ ifindex (1) -
key
_ len (1) - kill (1)
- last (2)
- length (2)
- level (2)
- lex (1)
- line (2)
-
line
_ width (1) - lines (2)
-
major
_ version (2) -
make
_ affine! (1) - match (1)
- maxwidth (1)
- mday (2)
-
method
_ id (1) -
minor
_ version (2) -
n
_ bytes (1) - nest (1)
- newline (1)
-
num
_ bytes (1) - offset (1)
-
ole
_ query _ interface (1) -
on
_ curve? (1) - output (1)
- pack (1)
- parse (1)
- permutation (2)
- pfamily (1)
-
point
_ conversion _ form (1) -
point
_ conversion _ form= (1) - pop (2)
- pos (1)
-
pretty
_ print (3) -
pretty
_ print _ cycle (1) -
pretty
_ print _ inspect (1) -
pretty
_ print _ instance _ variables (1) -
print
_ dependencies (1) - priority (2)
-
proxy
_ port (1) - proxyport (1)
-
public
_ key (1) - readbyte (3)
- recvmsg (1)
-
recvmsg
_ nonblock (1) -
repeated
_ combination (2) -
repeated
_ permutation (2) - retry (1)
-
return
_ vtype (1) - rindex (2)
- rotate (1)
- rotate! (1)
- sample (4)
-
save
_ history (1) - say (1)
- search (1)
-
server
_ port (1) -
session
_ cache _ stats (1) -
set
_ to _ infinity! (1) - setbyte (1)
- shift (2)
- size (10)
- socktype (1)
- sort (1)
- split (1)
- status (1)
- style (3)
-
summary
_ width (1) - sym (1)
-
sync
_ ex _ count (1) -
sync
_ point? (1) - sysaccept (2)
- sysopen (1)
- sysseek (1)
- syswrite (3)
- text (2)
-
to
_ a (1) -
to
_ bn (1) -
to
_ sym (2) -
try
_ constant (2) -
try
_ link (2) - type (1)
- typekind (1)
-
uid
_ search (1) -
uid
_ sort (1) - unpack (1)
- value (1)
- vartype (1)
-
verify
_ depth (2) -
verify
_ mode (2) -
verify
_ result (1) - version (1)
- wday (2)
- width (1)
-
write
_ nonblock (1) - yday (2)
- year (2)
検索結果
先頭5件
-
Socket
:: AncillaryData # int -> Integer (63679.0) -
自身が保持している cmsg data (データ) を整数の形で返します。
自身が保持している cmsg data (データ) を整数の形で返します。
整数データのサイズおよびエンディアンは実行するホストによって異なります。
require 'socket'
ancdata = Socket::AncillaryData.int(:UNIX, :SOCKET, :RIGHTS, STDERR.fileno)
p ancdata.int #=> 2
@raise TypeError cmgs data のサイズが int のバイト数と異なる場合に発生します
@see Socket::AncillaryData.new Socket::Ancillar... -
CGI
:: QueryExtension # gateway _ interface -> String (36604.0) -
ENV['GATEWAY_INTERFACE'] を返します。
ENV['GATEWAY_INTERFACE'] を返します。 -
Gem
:: Requirement # pretty _ print(pp) -> String (36604.0) -
わかりやすい形で、条件を表す文字列を返します。 pp メソッドで出力する際に、内部で用いられます。
わかりやすい形で、条件を表す文字列を返します。
pp メソッドで出力する際に、内部で用いられます。
@param PP :PP オブジェクトを指定します。
//emlist[][ruby]{
require 'pp'
req = Gem::Requirement.new(["< 5.0", ">= 1.9"])
pp req # => Gem::Requirement.new(["< 5.0", ">= 1.9"])
//} -
Object
# pretty _ print(pp) -> () (36604.0) -
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに 呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
PP.pp や Kernel.#pp がオブジェクトの内容を出力するときに
呼ばれるメソッドです。PP オブジェクト pp を引数として呼ばれます。
あるクラスの pp の出力をカスタマイズしたい場合は、このメソッドを再定義します。
そのとき pretty_print メソッドは指定された pp に対して表示したい自身の内容を追加して
いかなければいけません。いくつかの組み込みクラスについて、
pp ライブラリはあらかじめ pretty_print メソッドを定義しています。
@param pp PP オブジェクトです。
//emlist[][ruby]{
require 'pp'
... -
Object
# pretty _ print _ cycle(pp) -> () (36604.0) -
プリティプリント時にオブジェクトの循環参照が検出された場合、 Object#pretty_print の代わりに呼ばれるメソッドです。
プリティプリント時にオブジェクトの循環参照が検出された場合、
Object#pretty_print の代わりに呼ばれるメソッドです。
あるクラスの pp の出力をカスタマイズしたい場合は、
このメソッドも再定義する必要があります。
@param pp PP オブジェクトです。
//emlist[][ruby]{
class Array
def pretty_print_cycle(q)
q.text(empty? ? '[]' : '[...]')
end
end
//}
@see Object#pretty_print -
Object
# pretty _ print _ inspect -> String (36604.0) -
Object#pretty_print を使って Object#inspect と同様に オブジェクトを人間が読める形式に変換した文字列を返します。
Object#pretty_print を使って Object#inspect と同様に
オブジェクトを人間が読める形式に変換した文字列を返します。
出力する全てのオブジェクトに Object#pretty_print が定義されている必要があります。
そうでない場合には RuntimeError が発生します。
@raise RuntimeError 出力する全てのオブジェクトに Object#pretty_print が定義されて
いない場合に発生します。 -
Object
# pretty _ print _ instance _ variables -> [String | Symbol] (36604.0) -
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。 返されたインスタンス変数はプリティプリント時に表示されます。
プリティプリント時に表示すべき自身のインスタンス変数名の配列をソートして返します。
返されたインスタンス変数はプリティプリント時に表示されます。
pp に表示したくないインスタンス変数がある場合にこのメソッドを再定義します。 -
OpenSSL
:: BN # pretty _ print(pp) (36604.0) -
Kernel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。
Kernel.#pp でオブジェクトの内容を出力するときに、内部で呼ばれるメソッドです。
//emlist[][ruby]{
require 'pp'
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
@param pp PP クラスのインスタンスオブジェクト -
WIN32OLE
# ole _ query _ interface(iid) -> WIN32OLE (36604.0) -
IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを 持つオブジェクトを取得します。
IID(インターフェイスID)を指定してオブジェクトの別のインターフェイスを
持つオブジェクトを取得します。
オブジェクトが複数のオートメーション用インターフェイスを持つ場合に、当
メソッドを利用して既定のインターフェイスとは異なるインターフェイスを取
得します。
@param iid 取得するインターフェイスのIIDを文字列で指定します。
@return iidパラメータで指定したインターフェイスを持つWIN32OLEオブジェクト
@raise WIN32OLERuntimeError 指定したIIDをオブジェクトが持たない場合に通知されます。
ie = WIN32OLE.n... -
Zlib
:: Inflate # sync _ point? -> bool (36604.0) -
@todo zlib.h にもドキュメントが無い?
@todo zlib.h にもドキュメントが無い?
What is this? -
OpenSSL
:: PKey :: EC :: Group # point _ conversion _ form -> Symbol (27604.0) -
点のエンコーディング方式を返します。
点のエンコーディング方式を返します。
以下のいずれかを返します。
* :compressed
* :uncompressed
* :hybrid
詳しくは X9.62 (ECDSA) などを参照してください。
@raise OpenSSL::PKey::EC::Group::Error 得られたエンコーディングが未知の値であった
場合に発生します。
@see OpenSSL::PKey::EC::Group#point_conversion_form= -
OpenSSL
:: PKey :: EC :: Group # point _ conversion _ form=(sym) (27604.0) -
点のエンコーディング方式を設定します。
点のエンコーディング方式を設定します。
以下のいずれかを設定します。
* :compressed
* :uncompressed
* :hybrid
詳しくは X9.62 (ECDSA) などを参照してください。
@param sym 設定する方式(Symbol)
@see OpenSSL::PKey::EC::Group#point_conversion_form -
Sync
_ m # sync _ ex _ count -> Integer (27604.0) -
@todo
@todo -
WIN32OLE
_ TYPE # typekind -> Integer (27604.0) -
selfの種類を示す値を取得します。
selfの種類を示す値を取得します。
値の意味については、WIN32OLE_TYPE#ole_typeを参照してください。
@return 型の種類を示す数値を返します。
@raise WIN32OLERuntimeError 型の種類(TYPEKIND)を取得できない場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Word 14.0 Object Library', 'Documents')
p tobj.typekind # => 4
@see WIN32OLE_TYPE#ole_type -
Gem
:: Commands :: DependencyCommand # print _ dependencies(spec , level = 0) -> String (27304.0) -
依存関係を表す文字列を返します。
依存関係を表す文字列を返します。
@param spec Gem::Specification のインスタンスを指定します。
@param level 依存関係の深さを指定します。 -
Gem
:: UserInteraction # ask _ yes _ no(*args) -> bool (27304.0) -
イエス、ノーで答える質問をします。
イエス、ノーで答える質問をします。
@param args 委譲先のメソッドに与える引数です。
@return ユーザの回答がイエスの場合は真を、ノーの場合は偽を返します。 -
Gem
:: UserInteraction # say(*args) -> () (27304.0) -
与えられた文字列を表示します。
与えられた文字列を表示します。
@param args 委譲先のメソッドに与える引数です。 -
OpenSSL
:: PKey :: EC :: Point # infinity? -> bool (27304.0) -
自身が無限遠点であるならば true を返します。
自身が無限遠点であるならば true を返します。
@raise OpenSSL::PKey::EC::Point::Error エラーが生じた場合に発生します
@see OpenSSL::PKey::EC::Point#set_to_infinity! -
OpenSSL
:: PKey :: EC :: Point # set _ to _ infinity! -> self (27304.0) -
自身を無限遠点に設定します。
自身を無限遠点に設定します。
@raise OpenSSL::PKey::EC::Point::Error エラーが生じた場合に発生します
@see OpenSSL::PKey::EC::Point#infinity! -
Symbol
# intern -> self (27304.0) -
self を返します。
self を返します。
例:
:foo.intern # => :foo
@see String#intern -
Symbol
# to _ sym -> self (27304.0) -
self を返します。
self を返します。
例:
:foo.intern # => :foo
@see String#intern -
Proc
# arity -> Integer (18676.0) -
Proc オブジェクトが受け付ける引数の数を返します。
Proc オブジェクトが受け付ける引数の数を返します。
ただし、可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。
//emlist[例][ruby]{
lambda{ }.arity # => 0
lambda{|| }.arity # => 0
lambda{|x| }.arity # => 1
lambda{|*x| }.arity # => -1
lambda{|x, y| }.arity # => 2
lambda{|x, *y| }... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) (18658.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Kernel
# convertible _ int(type , headers = nil , opts = nil) { . . . } (18658.0) -
Returns the convertible integer type of the given +type+. You may optionally specify additional +headers+ to search in for the +type+. _Convertible_ means actually same type, or typedefed from same type. If the +type+ is a integer type and _convertible_ type is found, following macros are passed as preprocessor constants to the compiler using the +type+ name, in uppercase. * 'TYPEOF_', followed by the +type+ name, followed by '=X' where 'X' is the found _convertible_ type name. * 'TYP2NUM' and 'NUM2TYP, where 'TYP' is the +type+ name in uppercase with replacing '_t' suffix with 'T', followed by '=X' where 'X' is the macro name to convert +type+ to +Integer+ object, and vice versa. For example, if foobar_t is defined as unsigned long, then convertible_int("foobar_t") would return "unsigned long", and define macros: #define TYPEOF_FOOBAR_T unsigned long #define FOOBART2NUM ULONG2NUM #define NUM2FOOBART NUM2ULONG
Returns the convertible integer type of the given +type+. You may
optionally specify additional +headers+ to search in for the +type+.
_Convertible_ means actually same type, or typedefed from same type.
If the +type+ is a integer type and _convertible_ type is found,
following macros are p... -
Method
# arity -> Integer (18640.0) -
メソッドが受け付ける引数の数を返します。
メソッドが受け付ける引数の数を返します。
ただし、メソッドが可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。C 言語レベルで実装されたメソッドが可変長引数を
受け付ける場合、-1 を返します。
//emlist[例][ruby]{
class C
def u; end
def v(a); end
def w(*a); end
def x(a, b); end
def y(a, b, *c); end
def z(a, b, *... -
ARGF
. class # getbyte -> Integer | nil (18604.0) -
self から 1 バイト(0..255)を読み込み整数として返します。 既に EOF に達していれば nil を返します。
self から 1 バイト(0..255)を読み込み整数として返します。
既に EOF に達していれば nil を返します。
ARGF はスクリプトに指定した引数(Object::ARGV を参照) をファイル名
とみなして、それらのファイルを連結した 1 つの仮想ファイルを表すオブジェ
クトです。そのため、最初のファイルを最後まで読んだ後は次のファイルの内
容を返します。
$ echo "foo" > file1
$ echo "bar" > file2
$ ruby argf.rb file1 file2
ARGF.getbyte # => 102
ARGF.g... -
ARGF
. class # readbyte -> Integer (18604.0) -
自身から 1 バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。
自身から 1 バイトを読み込み整数として返します。
既に EOF に達していれば EOFError が発生します。
@raise EOFError 既に EOF に達している場合に発生します。
$ echo "foo" > file
$ ruby argf.rb file
ARGF.readbyte # => 102
ARGF.readbyte # => 111
ARGF.readbyte # => 111
ARGF.readbyte # => 10
ARGF.readbyte # => end of file reached (EOFError)... -
Addrinfo
# afamily -> Integer (18604.0) -
アドレスファミリーを整数で返します。
アドレスファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).afamily == Socket::AF_INET #=> true -
Addrinfo
# pfamily -> Integer (18604.0) -
プロトコルファミリーを整数で返します。
プロトコルファミリーを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).pfamily == Socket::PF_INET #=> true -
Addrinfo
# socktype -> Integer (18604.0) -
ソケットタイプを整数で返します。
ソケットタイプを整数で返します。
require 'socket'
Addrinfo.tcp("localhost", 80).socktype == Socket::SOCK_STREAM #=> true -
Date
# cwday -> Integer (18604.0) -
暦週の日 (曜日) を返します (1-7、月曜は1)。
暦週の日 (曜日) を返します (1-7、月曜は1)。 -
Date
# cwyear -> Integer (18604.0) -
暦週における年を返します。
暦週における年を返します。 -
Date
# day -> Integer (18604.0) -
月の日を返します (1-31)。
月の日を返します (1-31)。 -
Date
# mday -> Integer (18604.0) -
月の日を返します (1-31)。
月の日を返します (1-31)。 -
Date
# wday -> Integer (18604.0) -
曜日を返します (0-6、日曜日は零)。
曜日を返します (0-6、日曜日は零)。 -
Date
# yday -> Integer (18604.0) -
年の日を返します (1-366)。
年の日を返します (1-366)。 -
Date
# year -> Integer (18604.0) -
年を返します。
年を返します。 -
Fiddle
:: Closure # ctype -> Integer (18604.0) -
返り値の型を返します。
返り値の型を返します。 -
Fiddle
:: Importer # import _ symbol(name) -> Fiddle :: Pointer (18604.0) -
取り込んだライブラリからシンボルをインポートします。
取り込んだライブラリからシンボルをインポートします。
返り値はシンボルがロードされたメモリのアドレスを持つ Fiddle::Pointer
オブジェクトを返します。
@param name シンボル名(文字列) -
Gem
:: Package :: TarReader :: Entry # bytes _ read -> Integer (18604.0) -
自身から読み込んだバイト数を返します。
自身から読み込んだバイト数を返します。 -
IO
# getbyte -> Integer | nil (18604.0) -
IO から1バイトを読み込み整数として返します。 既に EOF に達していれば nil を返します。
IO から1バイトを読み込み整数として返します。
既に EOF に達していれば nil を返します。
f = File.new("testfile")
f.getbyte #=> 84
f.getbyte #=> 104 -
IO
# readbyte -> Integer (18604.0) -
IO から1バイトを読み込み整数として返します。 既に EOF に達していれば EOFError が発生します。
IO から1バイトを読み込み整数として返します。
既に EOF に達していれば EOFError が発生します。
@raise EOFError 既に EOF に達している場合に発生します。
//emlist[例][ruby]{
IO.write("testfile", "123")
File.open("testfile") do |f|
begin
f.readbyte # => 49
f.readbyte # => 50
f.readbyte # => 51
f.readbyte # => 例外発生
rescue => e
e... -
IO
# sysseek(offset , whence = IO :: SEEK _ SET) -> Integer (18604.0) -
lseek(2) と同じです。IO#seek では、 IO#sysread, IO#syswrite と併用すると正しく動作しないので代わりにこのメソッドを使います。 位置 offset への移動が成功すれば移動した位置(ファイル先頭からのオフセット)を返します。
lseek(2) と同じです。IO#seek では、
IO#sysread, IO#syswrite と併用すると正しく動作しないので代わりにこのメソッドを使います。
位置 offset への移動が成功すれば移動した位置(ファイル先頭からのオフセット)を返します。
書き込み用にバッファリングされた IO に対して実行すると警告が出ます。
File.open("/dev/zero") {|f|
buf = f.read(3)
f.sysseek(0)
}
# => -:3:in `sysseek': sysseek for buffered IO (IOErro... -
IO
# syswrite(string) -> Integer (18604.0) -
write(2) を用いて string を出力します。 string が文字列でなければ to_s による文字列化を試みます。 実際に出力できたバイト数を返します。
write(2) を用いて string を出力します。
string が文字列でなければ to_s による文字列化を試みます。
実際に出力できたバイト数を返します。
stdio を経由しないので他の出力メソッドと混用すると思わぬ動作
をすることがあります。
@param string 自身に書き込みたい文字列を指定します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。
@raise Errno::EXXX 出力に失敗した場合に発生します。
//emlist[例][ruby]{
File.open("testfile", "w+") do |... -
IPAddr
# family -> Integer (18604.0) -
このオブジェクトのアドレスファミリを返します。
このオブジェクトのアドレスファミリを返します。
@see Socket -
IRB
:: Context # eval _ history -> Integer | nil (18604.0) -
実行結果の履歴の最大保存件数を Integer か nil で返します。
実行結果の履歴の最大保存件数を Integer か nil で返します。
@return 履歴の最大保存件数を Integer か nil で返します。0 を返し
た場合は無制限に保存します。nil を返した場合は追加の保存は行いません。
@see IRB::Context#eval_history= -
IRB
:: Context # save _ history -> Integer | nil (18604.0) -
履歴の最大保存件数を Integer か nil で返します。
履歴の最大保存件数を Integer か nil で返します。
@return 履歴の最大保存件数を Integer か nil で返します。0 以下や
nil を返した場合は追加の保存は行いません。
@see lib:irb#history -
Kernel
# try _ constant(const , headers = nil , opt = "") -> Integer | nil (18604.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
Kernel
# try _ constant(const , headers = nil , opt = "") { . . . } -> Integer | nil (18604.0) -
定数 const がシステムに存在するかどうか検査します。 Kernel#have_const を使ってください。
定数 const がシステムに存在するかどうか検査します。
Kernel#have_const を使ってください。
@param const C 言語の定数名を指定します。
@param headers 追加のヘッダファイルを指定します。
@param opt コンパイラに渡すオプションを指定します。
$CFLAGS もコンパイラには渡されます。
@return 定数 const がシステムに存在する場合はその値を返します。
定数 const がシステムに存在しない場合は nil を返します。 -
Net
:: HTTP # proxy _ port -> Integer|nil (18604.0) -
プロクシのポート番号を返します。
プロクシのポート番号を返します。
プロクシを使わない場合は nil を返します。
proxyport は時代遅れのメソッドです。
@see Net::HTTP#proxy_port=, Net::HTTP#proxy_address, Net::HTTP.new -
Net
:: HTTP # proxyport -> Integer|nil (18604.0) -
プロクシのポート番号を返します。
プロクシのポート番号を返します。
プロクシを使わない場合は nil を返します。
proxyport は時代遅れのメソッドです。
@see Net::HTTP#proxy_port=, Net::HTTP#proxy_address, Net::HTTP.new -
Net
:: HTTP # verify _ depth -> Integer (18604.0) -
証明書チェイン上の検証する最大の深さを返します。
証明書チェイン上の検証する最大の深さを返します。
@see Net::HTTP#verify_depth=, OpenSSL::SSL::SSLContext#verify_depth -
Net
:: HTTP # verify _ mode -> Integer | nil (18604.0) -
検証モードを返します。
検証モードを返します。
デフォルトは nil です。 -
Net
:: POP3 # n _ bytes -> Integer (18604.0) -
サーバにあるメールの総バイト数を返します。
サーバにあるメールの総バイト数を返します。
@see Net::POP3#n_mails
@raise TimeoutError 接続がタイムアウトした場合に発生します
@raise Net::POPError サーバがエラーを報告した場合に発生します
@raise Net::POPBadResponse サーバからの応答がプロトコル上不正であった場合に発生します -
OpenSSL
:: BN # num _ bytes -> Integer (18604.0) -
自身を表現するのに使っているバイト数を返します。
自身を表現するのに使っているバイト数を返します。
//emlist[][ruby]{
require 'openssl'
p 0.to_bn.num_bytes # => 0
p 255.to_bn.num_bytes # => 1
p 256.to_bn.num_bytes # => 2
p 0b111_11111.to_bn.num_bytes # => 1
p 0b1000_00000.to_bn.num_bytes # => 2
//} -
OpenSSL
:: Cipher # key _ len -> Integer (18604.0) -
暗号鍵の長さをバイト数で返します。
暗号鍵の長さをバイト数で返します。 -
OpenSSL
:: OCSP :: BasicResponse # copy _ nonce(request) -> Integer (18604.0) -
request から nonce の値をコピーします。
request から nonce の値をコピーします。
@param request コピー元のnonceを保持している Request (OpenSSL::OCSP::Request オブジェクト) -
OpenSSL
:: PKey :: EC # public _ key -> OpenSSL :: PKey :: EC :: Point|nil (18604.0) -
公開鍵となる楕円曲線上の点を表すオブジェクトを返します。
公開鍵となる楕円曲線上の点を表すオブジェクトを返します。
鍵が設定されていない場合は nil を返します。
@raise OpenSSL::PKey::ECError 公開鍵の取得時にエラーが生じた場合に発生します
@see OpenSSL::PKey::EC#public_key= -
OpenSSL
:: SSL :: SSLContext # verify _ depth -> Integer | nil (18604.0) -
証明書チェイン上の検証する最大の深さを返します。
証明書チェイン上の検証する最大の深さを返します。
デフォルトは nil です。
@see OpenSSL::SSL::SSLContext#verify_depth= -
OpenSSL
:: SSL :: SSLContext # verify _ mode -> Integer | nil (18604.0) -
検証モードを返します。
検証モードを返します。
デフォルトは nil です。
@see OpenSSL::SSL::SSLContext#verify_mode= -
OpenSSL
:: SSL :: SSLSocket # syswrite(string) -> Integer (18604.0) -
データをバッファを経由せずに暗号化通信路に書き込みます。
データをバッファを経由せずに暗号化通信路に書き込みます。
書き込んだバイト数を整数で返します。
基本的にはこのメソッドは使わず、OpenSSL::Buffering の
メソッドを使ってデータを書き込むべきです。
IO#syswrite と同様です。
@param string 書き込むデータ文字列
@raise OpenSSL::SSL::SSLError 書き込みに失敗した場合に発生します -
OpenSSL
:: SSL :: SSLSocket # verify _ result -> Integer (18604.0) -
検証結果のエラーコードを整数値で返します。
検証結果のエラーコードを整数値で返します。
エラーコードの整数値は OpenSSL::X509 に定数が定義されています。
詳しくは c:OpenSSL::X509#verify_error を見てください。
検証に成功した場合は OpenSSL::X509::V_OK を返します。 -
OptionParser
# summary _ width -> Integer (18604.0) -
サマリを表示するときの幅を整数で返します。
サマリを表示するときの幅を整数で返します。
@return サマリを表示するときの幅を整数で返します。
//emlist[例][ruby]{
require "optparse"
opts = OptionParser.new do |opts|
opts.on_head("-i", "--init")
opts.on("-u", "--update")
opts.on_tail("-h", "--help")
end
opts.summary_width # => 32
opts.summarize
# => [" -i, --init\n", " ... -
Pathname
# sysopen(*args) -> Integer (18604.0) -
IO.sysopen(self.to_s, *args)と同じです。
IO.sysopen(self.to_s, *args)と同じです。
@see IO.sysopen -
Psych
:: Nodes :: Mapping # style -> Integer (18604.0) -
mapping の style を返します。
mapping の style を返します。
@see Psych::Nodes::Mapping#style=,
Psych::Nodes::Mapping.new -
Psych
:: Nodes :: Scalar # style -> Integer (18604.0) -
scalar の style を返します。
scalar の style を返します。
@see Psych::Nodes::Scalar#style=,
Psych::Nodes::Scalar.new -
Psych
:: Nodes :: Sequence # style -> Integer (18604.0) -
sequence の style を返します。
sequence の style を返します。
@see Psych::Nodes::Sequence#style=,
Psych::Nodes::Sequence.new -
Resolv
:: DNS :: Resource :: IN :: SRV # priority -> Integer (18604.0) -
ホストの優先順位を返します。
ホストの優先順位を返します。
クライアントは利用可能なホストの中で最も priority が
小さい数値のホストを利用しなければなりません。
priority が同じならば Resolv::DNS::Resource::IN::SRV#weight
で定義されるようにホストを選ぶべきです。
返り値の範囲は 0 から 65535 までの整数値です。 -
Resolv
:: DNS :: Resource :: SOA # retry -> Integer (18604.0) -
セカンダリサーバがプライマリサーバからの情報更新に失敗した場合に 何秒後にリトライするかを返します。
セカンダリサーバがプライマリサーバからの情報更新に失敗した場合に
何秒後にリトライするかを返します。 -
Socket
:: AncillaryData # family -> Integer (18604.0) -
自身が保持している socket family を返します。
自身が保持している socket family を返します。
require 'socket'
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").family
#=> 10
@see Socket::AncillaryData.new -
Socket
:: AncillaryData # type -> Integer (18604.0) -
自身が保持している cmsg type (種類) を返します。
自身が保持している cmsg type (種類) を返します。
require 'socket'
p Socket::AncillaryData.new(:INET6, :IPV6, :PKTINFO, "").type
#=> 2
@see Socket::AncillaryData.new -
Socket
:: Option # family -> Integer (18604.0) -
ソケットファミリを表す整数を返します。
ソケットファミリを表す整数を返します。 -
String
# bytes -> [Integer] (18604.0) -
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
文字列の各バイトを数値の配列で返します。(self.each_byte.to_a と同じです)
//emlist[例][ruby]{
"str".bytes # => [115, 116, 114]
//}
ブロックが指定された場合は String#each_byte と同じように動作します。
Ruby 2.6 までは deprecated の警告が出ますが、Ruby 2.7 で警告は削除されました。
@see String#each_byte -
String
# bytesize -> Integer (18604.0) -
文字列のバイト長を整数で返します。
文字列のバイト長を整数で返します。
//emlist[例][ruby]{
#coding:UTF-8
# 実行結果は文字コードによって異なります。
p "いろは".size #=> 3
p "いろは".bytesize #=> 9
//}
@see String#size -
String
# getbyte(index) -> Integer | nil (18604.0) -
index バイト目のバイトを整数で返します。
index バイト目のバイトを整数で返します。
index に負を指定すると末尾から数えた位置のバイト
を取り出します。
範囲外を指定した場合は nil を返します。
@param index バイトを取り出す位置
//emlist[例][ruby]{
s = "tester"
s.bytes # => [116, 101, 115, 116, 101, 114]
s.getbyte(0) # => 116
s.getbyte(1) # => 101
s.getbyte(-1) # => 114
s.getbyte(6) ... -
String
# intern -> Symbol (18604.0) -
文字列に対応するシンボル値 Symbol を返します。
文字列に対応するシンボル値 Symbol を返します。
なお、このメソッドの逆にシンボルに対応する文字列を得るには
Symbol#to_s または Symbol#id2name を使います。
シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。
//emlist[例][ruby]{
p "foo".intern # => :foo
p "foo".intern.to_s == "foo" # => true
//} -
String
# setbyte(index , b) -> Integer (18604.0) -
index バイト目のバイトを b に変更します。
index バイト目のバイトを b に変更します。
index に負を指定すると末尾から数えた位置を変更します。
セットした値を返します。
@param index バイトをセットする位置
@param b セットするバイト(0 から 255 までの整数)
@raise IndexError 範囲外に値をセットしようとした場合に発生します。
//emlist[例][ruby]{
s = "Sunday"
s.setbyte(0, 77)
s.setbyte(-5, 111)
s # => "Monday"
//} -
String
# to _ sym -> Symbol (18604.0) -
文字列に対応するシンボル値 Symbol を返します。
文字列に対応するシンボル値 Symbol を返します。
なお、このメソッドの逆にシンボルに対応する文字列を得るには
Symbol#to_s または Symbol#id2name を使います。
シンボル文字列にはヌルキャラクタ("\0")、空の文字列の使用も可能です。
//emlist[例][ruby]{
p "foo".intern # => :foo
p "foo".intern.to_s == "foo" # => true
//} -
StringIO
# getbyte -> Integer | nil (18604.0) -
自身から 1 文字読み込んで、その文字に対応する Fixnum を返します。 文字列の終端に到達した時には nil を返します。
自身から 1 文字読み込んで、その文字に対応する Fixnum を返します。
文字列の終端に到達した時には nil を返します。
@raise IOError 自身が読み取り不可なら発生します。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("ho")
a.getbyte #=> 104
a.getbyte #=> 111
a.getbyte #=> nil
//} -
StringIO
# readbyte -> Integer (18604.0) -
自身から 1 文字読み込んで、その文字に対応する整数を返します。
自身から 1 文字読み込んで、その文字に対応する整数を返します。
文字列の終端に到達した時には例外 EOFError を発生させます。
//emlist[例][ruby]{
require "stringio"
a = StringIO.new("hoge")
a.readbyte #=> 104
//}
@raise EOFError 文字列の終端に到達した時に発生します。 -
StringIO
# syswrite(obj) -> Integer (18604.0) -
自身に obj を書き込みます。StringIO#write と同じです。
自身に obj を書き込みます。StringIO#write と同じです。
@param obj 書き込みたいオブジェクトを指定します。
@raise IOError 自身が書き込み用にオープンされていなければ発生します。 -
TCPServer
# sysaccept -> Integer (18604.0) -
接続したクライアントのソケットをファイル記述子で返すことを除けば TCPServer#accept と同じです。
接続したクライアントのソケットをファイル記述子で返すことを除けば
TCPServer#accept と同じです。
例:
require 'socket'
TCPServer.open("", 0) {|serv|
c = TCPSocket.new(*serv.addr.values_at(3,1))
p serv.sysaccept #=> 6
} -
Thread
# priority -> Integer (18604.0) -
スレッドの優先度を返します。この値が大きいほど優先度が高くなります。 メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの priority を引き継ぎます。
スレッドの優先度を返します。この値が大きいほど優先度が高くなります。
メインスレッドのデフォルト値は 0 です。新しく生成されたスレッドは親スレッドの
priority を引き継ぎます。
@param val スレッドの優先度を指定します。プラットフォームに依存します。
//emlist[例][ruby]{
Thread.current.priority # => 0
count1 = count2 = 0
a = Thread.new do
loop { count1 += 1 }
end
a.priority = -1
b = Thread.new do
... -
Time
# day -> Integer (18604.0) -
日を整数で返します。
日を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//} -
Time
# mday -> Integer (18604.0) -
日を整数で返します。
日を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.day # => 2
p t.mday # => 2
//} -
Time
# wday -> Integer (18604.0) -
曜日を0(日曜日)から6(土曜日)の整数で返します。
曜日を0(日曜日)から6(土曜日)の整数で返します。
//emlist[][ruby]{
p sun = Time.new(2017, 9, 17, 10, 34, 15, '+09:00') # => 2017-09-17 10:34:15 +0900
p sun.wday # => 0
p mon = Time.new(2017, 9, 18, 10, 34, 15, '+09:00') # => 2017-09-18 10:34:15 +0900
p mon.wday ... -
Time
# yday -> Integer (18604.0) -
1月1日を1とした通算日(1から366まで)を整数で返します。
1月1日を1とした通算日(1から366まで)を整数で返します。
//emlist[][ruby]{
p Time.mktime(2000, 1, 1).yday # => 1
//}
うるう年の場合は、2月29日も含めた通算日を返します。
//emlist[うるう年でない場合][ruby]{
p Time.mktime(2003, 1, 1).yday # => 1
p Time.mktime(2003, 3, 1).yday # => 60
p Time.mktime(2003, 12, 31).yday # => 365
//}
//emlist[うるう年の場合][r... -
Time
# year -> Integer (18604.0) -
年を整数で返します。
年を整数で返します。
//emlist[][ruby]{
t = Time.local(2000,1,2,3,4,5) # => 2000-01-02 03:04:05 +0900
p t.year # => 2000
//} -
UNIXServer
# sysaccept -> Integer (18604.0) -
接続したクライアントのソケットをファイル記述子で返すことを除けば UNIXServer#accept と同じです。
接続したクライアントのソケットをファイル記述子で返すことを除けば
UNIXServer#accept と同じです。
例:
require 'socket'
UNIXServer.open("/tmp/s") {|serv|
c = UNIXSocket.open("/tmp/s")
p serv.sysaccept #=> 6
} -
UnboundMethod
# arity -> Integer (18604.0) -
メソッドが受け付ける引数の数を返します。
メソッドが受け付ける引数の数を返します。
ただし、メソッドが可変長引数を受け付ける場合、負の整数
-(必要とされる引数の数 + 1)
を返します。C 言語レベルで実装されたメソッドが可変長引数を
受け付ける場合、-1 を返します。
//emlist[例][ruby]{
class C
def one; end
def two(a); end
def three(*a); end
def four(a, b); end
def five(a, b, *c); end
def six(a, b, *c, &d); end
end
p C.insta... -
WIN32OLE
_ METHOD # return _ vtype -> Integer (18604.0) -
メソッドの返り値の型を示す数値を取得します。
メソッドの返り値の型を示す数値を取得します。
@return 返り値の型を示す数値(VARENUM)を返します。
@raise WIN32OLERuntimeError メソッドの型情報を取得できなかった場合に通知します。
tobj = WIN32OLE_TYPE.new('Microsoft Excel 14.0 Object Library', 'Application')
method = WIN32OLE_METHOD.new(tobj, 'Visible')
puts method.return_vtype # => 11
VARENUMの定義は、Platfo... -
WIN32OLE
_ VARIANT # vartype -> Integer (18604.0) -
selfの型情報を取得します。
selfの型情報を取得します。
型情報は、WIN32OLE::VARIANTの定数値の組み合わせです。
obj = WIN32OLE_VARIANT.new("string")
obj.vartype # => 8 (WIN32OLE::VARIANT::VT_BSTR)
bytes = WIN32OLE_VARIANT.new([1,2,3,4,5], VT_UI1 | VT_ARRAY)
bytes.vartype # => 8209 (WIN32OLE::VARIANT::VT_ARRAY | VT_UI1) -
Zlib
:: ZStream # data _ type -> Integer (18604.0) -
ストリームに入力されたデータの形式を推測します。 返り値は Zlib::BINARY, Zlib::ASCII, Zlib::UNKNOWN の いずれかです。
ストリームに入力されたデータの形式を推測します。
返り値は Zlib::BINARY, Zlib::ASCII, Zlib::UNKNOWN の
いずれかです。 -
Array
# cycle(n=nil) -> Enumerator (18322.0) -
配列の全要素を n 回(nilの場合は無限に)繰り返しブロックを呼びだします。
配列の全要素を n 回(nilの場合は無限に)繰り返しブロックを呼びだします。
ブロックを省略した場合は Enumerator を返します。
@param n 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = ["a", "b", "c"]
a.cycle {|x| p... -
Array
# cycle(n=nil) {|obj| block } -> nil (18322.0) -
配列の全要素を n 回(nilの場合は無限に)繰り返しブロックを呼びだします。
配列の全要素を n 回(nilの場合は無限に)繰り返しブロックを呼びだします。
ブロックを省略した場合は Enumerator を返します。
@param n 繰り返したい回数を整数で指定します。
整数以外のオブジェクトを指定した場合は to_int メソッドによる暗
黙の型変換を試みます。
@raise TypeError 引数に整数以外の(暗黙の型変換が行えない)オブジェクトを
指定した場合に発生します。
//emlist[例][ruby]{
a = ["a", "b", "c"]
a.cycle {|x| p... -
Kernel
# try _ link(src , opt = "" , *options) -> bool (18322.0) -
C プログラムのソースコード src をコンパイル、リンクします。
C プログラムのソースコード src をコンパイル、リンクします。
このメソッドは $CFLAGS と $LDFLAGS の値もコンパイラまたはリ
ンカに渡します。
問題なくリンクできたら true を返します。
コンパイルとリンクに失敗したら false を返します。
@param src C プログラムのソースコードを指定します。
@param opt リンカにコマンド引数として渡す値を指定します。
例:
require 'mkmf'
if try_link("int main() { sin(0.0); }", '-lm')
$stderr.puts "si... -
Kernel
# try _ link(src , opt = "" , *options) { . . . } -> bool (18322.0) -
C プログラムのソースコード src をコンパイル、リンクします。
C プログラムのソースコード src をコンパイル、リンクします。
このメソッドは $CFLAGS と $LDFLAGS の値もコンパイラまたはリ
ンカに渡します。
問題なくリンクできたら true を返します。
コンパイルとリンクに失敗したら false を返します。
@param src C プログラムのソースコードを指定します。
@param opt リンカにコマンド引数として渡す値を指定します。
例:
require 'mkmf'
if try_link("int main() { sin(0.0); }", '-lm')
$stderr.puts "si... -
OpenSSL
:: PKey :: EC :: Point # group -> OpenSSL :: PKey :: EC :: Group (18304.0) -
自身と関連付けられた群を返します。
自身と関連付けられた群を返します。 -
PrettyPrint
# indent -> Integer (18304.0) -
現在のインデントの深さを返します。
現在のインデントの深さを返します。 -
PrettyPrint
# maxwidth -> Integer (18304.0) -
自身の幅を返します。
自身の幅を返します。