ライブラリ
- ビルトイン (495)
- csv (24)
- date (4)
-
fiddle
/ import (144) - json (12)
- mkmf (24)
- objspace (12)
- openssl (60)
- ostruct (125)
- rake (12)
-
rexml
/ document (120) -
rexml
/ parsers / pullparser (12) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12) - socket (24)
- zlib (12)
クラス
- Addrinfo (12)
- Array (31)
- CSV (24)
- Data (3)
- Date (2)
- DateTime (2)
-
Fiddle
:: CStruct (60) - Hash (10)
-
OpenSSL
:: ASN1 :: Constructive (36) - OpenStruct (125)
-
REXML
:: Element (12) -
REXML
:: Instruction (96) -
REXML
:: Parsers :: PullEvent (12) -
Rake
:: Application (12) - Range (12)
-
RubyVM
:: InstructionSequence (174) -
Socket
:: Option (12) - String (12)
- Struct (227)
- Time (2)
モジュール
-
Fiddle
:: Importer (72) - Kernel (24)
- ObjectSpace (36)
-
OpenSSL
:: ASN1 (12) -
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12)
キーワード
- == (36)
- CStruct (12)
- CircularDatastructure (12)
- Constructive (12)
-
DATA
_ PTR (12) -
Data
_ Get _ Struct (12) -
Data
_ Make _ Struct (12) -
Data
_ Wrap _ Struct (12) - Instruction (12)
- Marshal フォーマット (12)
- RARRAY (12)
- RBASIC (12)
- RBIGNUM (12)
- RCLASS (12)
- RDATA (12)
- RFILE (12)
- RFLOAT (12)
- RHASH (12)
- RMODULE (12)
- ROBJECT (12)
- RREGEXP (12)
- RSTRING (12)
- RSTRUCT (12)
- Ruby用語集 (12)
- ZStream (12)
- []= (24)
-
absolute
_ path (12) -
base
_ label (12) - bigdecimal (12)
-
blk
_ copy _ prev (12) -
blk
_ free (12) -
blk
_ mark (12) -
blk
_ orphan (12) - clone (12)
- compile (12)
-
compile
_ file (12) -
compile
_ option (12) -
compile
_ option= (12) - content (12)
- content= (12)
- convert (24)
-
count
_ tdata _ objects (12) -
create
_ value (12) -
deconstruct
_ keys (9) -
delete
_ field (12) - dig (40)
- disassemble (24)
- each (24)
-
each
_ object (24) -
each
_ pair (24) - eql? (24)
- equal? (12)
- eval (12)
-
fc
_ i (12) -
fc
_ path (12) - fiddle (12)
-
fiddle
/ import (12) -
fiddle
/ types (12) - filter (14)
-
first
_ lineno (12) -
gvar
_ i (12) -
have
_ struct _ member (24) - instruction (12)
- instruction? (12)
- instructions (12)
-
ivar
_ i (12) -
keyword
_ init? (4) - label (12)
- length (12)
- linger (12)
-
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) - malloc (12)
-
mark
_ global _ entry (12) - members (24)
- modifiable (12)
- new (96)
-
new
_ blktag (12) -
new
_ dvar (12) -
new
_ ostruct _ member (12) -
node
_ type (12) - pack (21)
- pack テンプレート文字列 (12)
-
processing
_ instruction (12) -
rb
_ exec _ arg _ addopt (1) -
rb
_ exec _ arg _ init (1) -
rb
_ exec _ err (1) -
rb
_ global _ entry (12) -
rb
_ gvar _ defined (12) -
rb
_ gvar _ get (12) -
rb
_ gvar _ set (12) -
rb
_ reserved _ word (12) -
rb
_ struct _ iv _ get (1) -
rb
_ thread _ select (1) -
rb
_ thread _ wait _ for (12) -
rb
_ time _ timespec _ new (10) -
remove
_ trace (12) -
rexml
/ document (12) -
ruby 1
. 8 . 2 feature (12) - select (24)
- size (24)
- sizeof (12)
-
st
_ init _ table (12) -
st
_ init _ table _ with _ size (12) - tagging (12)
- tagging= (12)
- target (12)
- target= (12)
-
to
_ binary (10) -
to
_ h (26) -
to
_ i (12) -
to
_ ptr (12) -
trace
_ en (12) -
trace
_ ev (12) - traverse (12)
- typealias (12)
-
undef
_ setter (12) - union (12)
- unpack (12)
-
val
_ setter (12) - value (12)
- values (12)
-
values
_ at (12) - yaml (12)
-
yaml
/ store (12)
検索結果
先頭5件
-
Fiddle
:: Importer # struct(signature) -> Class (21219.0) -
C の構造体型に対応する Ruby のクラスを構築して返します。
...列で signature に渡してデータを定義します。例えば C における
struct timeval {
long tv_sec;
long tv_usec;
};
という構造体型に対応して
Timeval = struct(["long tv_sec", "long tv_usec"])
として構造体に対応するクラスを生成します。
こ......スには以下のメソッドが定義されています
* クラスメソッド malloc
* initialize
* to_ptr
* to_i
* 構造体の各メンバへのアクセサ
返されるクラスは Fiddle::CStruct を継承しています。詳しくは
そちらを参照してください。
@par......の配列
require 'fiddle/import'
module M
extend Fiddle::Importer
dlload "libc.so.6"
extern "int gettimeofday(void*, void*)"
Timeval = struct(["long tv_sec", "long tv_usec"])
end
time = M::Timeval.malloc
M.gettimeofday(time, Fiddle::NULL)
p time.tv_sec
p time.tv... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (15400.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......lse、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# irb
RubyVM::InstructionSequence.compile_file("/tmp/hel......lo.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
Struct
# filter -> Enumerator (15136.0) -
構造体のメンバの値に対してブロックを評価した値が真であった要素を全て含 む配列を返します。真になる要素がひとつもなかった場合は空の配列を返しま す。
.../emlist[例][ruby]{
Lots = Struct.new(:a, :b, :c, :d, :e, :f)
l = Lots.new(11, 22, 33, 44, 55, 66)
l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.ne......w は Struct の下位クラスを作成する点に
注意してください。
@see Enumerable#select... -
Struct
# filter {|i| . . . } -> [object] (15136.0) -
構造体のメンバの値に対してブロックを評価した値が真であった要素を全て含 む配列を返します。真になる要素がひとつもなかった場合は空の配列を返しま す。
.../emlist[例][ruby]{
Lots = Struct.new(:a, :b, :c, :d, :e, :f)
l = Lots.new(11, 22, 33, 44, 55, 66)
l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.ne......w は Struct の下位クラスを作成する点に
注意してください。
@see Enumerable#select... -
Struct
# select -> Enumerator (15136.0) -
構造体のメンバの値に対してブロックを評価した値が真であった要素を全て含 む配列を返します。真になる要素がひとつもなかった場合は空の配列を返しま す。
.../emlist[例][ruby]{
Lots = Struct.new(:a, :b, :c, :d, :e, :f)
l = Lots.new(11, 22, 33, 44, 55, 66)
l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.ne......w は Struct の下位クラスを作成する点に
注意してください。
@see Enumerable#select... -
Struct
# select {|i| . . . } -> [object] (15136.0) -
構造体のメンバの値に対してブロックを評価した値が真であった要素を全て含 む配列を返します。真になる要素がひとつもなかった場合は空の配列を返しま す。
.../emlist[例][ruby]{
Lots = Struct.new(:a, :b, :c, :d, :e, :f)
l = Lots.new(11, 22, 33, 44, 55, 66)
l.select {|v| (v % 2).zero? } #=> [22, 44, 66]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.ne......w は Struct の下位クラスを作成する点に
注意してください。
@see Enumerable#select... -
Struct
# eql?(other) -> bool (15130.0) -
self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Struct.......#=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成す......る点に
注意してください。
@see Struct#==... -
Struct
# equal?(other) -> bool (15130.0) -
指定された other が self 自身である場合のみ真を返します。 これは Object クラスで定義されたデフォルトの動作で す。
...self 自身である場合のみ真を返します。
これは Object クラスで定義されたデフォルトの動作で
す。
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の......下位クラスを作成する点に
注意してください。
@see Struct#eql?, Struct#==... -
Struct
# length -> Integer (15124.0) -
構造体のメンバの数を返します。
... Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Mapl......e, Anytown NC", 12345)
joe.length #=> 3
//}... -
Struct
# values -> [object] (15124.0) -
構造体のメンバの値を配列にいれて返します。
...列にいれて返します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345).to_a
# => ["Joe Smith", "123 Maple, Anytown NC", 12345]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンス......に対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects...