72件ヒット
[1-72件を表示]
(0.086秒)
種類
- インスタンスメソッド (57)
- 文書 (12)
- ライブラリ (3)
ライブラリ
- ビルトイン (57)
クラス
- Array (21)
- BasicObject (24)
- String (12)
キーワード
- != (12)
- pack (21)
- pack テンプレート文字列 (12)
- unpack (12)
- xmlrpc (3)
検索結果
先頭5件
-
BasicObject
# ! -> bool (24137.0) -
オブジェクトを真偽値として評価し、その論理否定を返します。
...または false であれば真を、さもなくば偽を返します。
主に論理式の評価に伴って副作用を引き起こすことを目的に
再定義するものと想定されています。
このメソッドを再定義しても Ruby の制御式において nil や false 以外......ass NegationRecorder < BasicObject
def initialize
@count = 0
end
attr_reader :count
def !
@count += 1
super
end
end
recorder = NegationRecorder.new
!recorder
!!!!!!!recorder
puts 'hoge' if !recorder
puts recorder.count #=> 3
//}
//emlist[例][ruby]{
class AnotherFalse < Ba......sicObject
def !
true
end
end
another_false = AnotherFalse.new
# another_falseは*真*
puts "another false is a truth" if another_false
#=> "another false is a truth"
//}... -
BasicObject
# !=(other) -> bool (12100.0) -
オブジェクトが other と等しくないことを判定します。
...論理否定して返します。
このため、サブクラスで BasicObject#== を再定義しても != とは自動的に整合性が
とれるようになっています。
ただし、 BasicObject#!= 自身や BasicObject#! を再定義した際には、ユーザーの責任で
整合性を......す。
@param other 比較対象となるオブジェクト
@see BasicObject#==, BasicObject#!
//emlist[例][ruby]{
class NonequalityRecorder < BasicObject
def initialize
@count = 0
end
attr_reader :count
def !=(other)
@count += 1
super
end
end
recorder = NonequalityRecorder.......new
recorder != 1
puts 'hoge' if recorder != "str"
p recorder.count #=> 2
//}... -
Array
# pack(template) -> String (6652.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。
テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデ......してください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックす......:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("w") # => "\x01"
[127].pack("w") # => "\x7F"
[128].pack("w")... -
Array
# pack(template , buffer: String . new) -> String (6652.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。
テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデ......してください。
buffer のサイズ(capacity)が足りなければ、packはメモリを確保します。
//emlist[例][ruby]{
['!'].pack('@1a', buffer: 'abc') # => "a!"
['!'].pack('@5a', buffer: 'abc') # => "abc\u0000\u0000!"
//}
@param template 自身のバイナリとしてパックす......:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("w") # => "\x01"
[127].pack("w") # => "\x7F"
[128].pack("w")... -
Array
# pack(template) -> String (6634.0) -
配列の内容を template で指定された文字列にしたがって、 バイナリとしてパックした文字列を返します。
...配列の内容を template で指定された文字列にしたがって、
バイナリとしてパックした文字列を返します。
テンプレートは
型指定文字列とその長さ(省略時は1)を並べたものです。長さと
して * が指定された時は「残りのデ......に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("w") # => "\x01"
[127].pack("w") # => "\x7F"
[128].pack("w")... -
String
# unpack(template) -> Array (6634.0) -
Array#pack で生成された文字列を テンプレート文字列 template にしたがってアンパックし、 それらの要素を含む配列を返します。
...
Array#pack で生成された文字列を
テンプレート文字列 template にしたがってアンパックし、
それらの要素を含む配列を返します。
@param template pack テンプレート文字列
@return オブジェクトの配列
以下にあげるもの......に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("w") # => "\x01"
[127].pack("w") # => "\x7F"
[128].pack("w")... -
pack テンプレート文字列 (6534.0)
-
pack テンプレート文字列
...pack テンプレート文字列
以下にあげるものは、Array#pack、String#unpack
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで「残り全て」......に _ または ! を "s_" あるいは "s!" のように
続けることでシステム依存の short, long のサイズにすることもできます。
i, I (int)のサイズは常にシステム依存であり、n, N, v, V
のサイズは常にシステム依存ではない(!をつけられな......:1995 : Information technology−ASN.1 encoding rules : Specification of Basic Encoding Rules(BER) に定められる整数の符号化方法。
//emlist[][ruby]{
[0].pack("w") # => "\x00"
[1].pack("w") # => "\x01"
[127].pack("w") # => "\x7F"
[128].pack("w")......pack テンプレート文字列
以下にあげるものは、Array#pack、String#unpack、String#unpack1
のテンプレート文字の一覧です。テンプレート文字は後に「長さ」を表す数字
を続けることができます。「長さ」の代わりに`*'とすることで... -
xmlrpc (72.0)
-
XML-RPC を扱うためのライブラリです。
...い。
=== Author and Copyright
Copyright (C) 2001-2004 by Michael Neumann
Released under the same term of license as Ruby.
=== Overview
XMLRPC is a lightweight protocol that enables remote procedure calls over
HTTP. It is defined at http://www.xmlrpc.com.
XMLRPC allows you to create simple d......* multiCall
* optionally nil values and integers larger than 32 Bit
* Server
* Standalone XML-RPC server
* CGI-based (works with FastCGI)
* Apache mod_ruby server
* WEBrick servlet
* Client
* synchronous/asynchronous calls
* Basic HTTP-401 Authentification
*......arsers
* NQXML (NQXMLStreamParser, NQXMLTreeParser)
* Expat (XMLStreamParser, XMLTreeParser)
* REXML (REXMLStreamParser)
* xml-scan (XMLScanStreamParser)
* Fastest parser is Expat's XMLStreamParser!
* General
* possible to choose between XMLParser module (Expat wrapper) a...