ライブラリ
- ビルトイン (426)
-
fiddle
/ import (121) - mkmf (22)
- objspace (11)
- openssl (33)
- ostruct (103)
- rake (11)
-
rexml
/ document (77) -
rexml
/ parsers / pullparser (11) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11) - socket (22)
- zlib (11)
クラス
- Addrinfo (11)
- Array (28)
- Data (2)
-
Fiddle
:: CStruct (55) - Hash (9)
-
OpenSSL
:: ASN1 :: Constructive (22) - OpenStruct (103)
-
REXML
:: Element (11) -
REXML
:: Instruction (66) -
REXML
:: Parsers :: PullEvent (11) -
Rake
:: Application (11) - Range (11)
-
RubyVM
:: InstructionSequence (148) -
Socket
:: Option (11) - String (11)
- Struct (195)
モジュール
-
Fiddle
:: Importer (66) - Kernel (22)
- ObjectSpace (33)
-
OpenSSL
:: ASN1 (11) -
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11)
キーワード
- == (33)
- Marshal フォーマット (11)
- ZStream (11)
-
absolute
_ path (11) -
base
_ label (11) - bigdecimal (11)
- clone (11)
- compile (11)
-
compile
_ file (11) -
compile
_ option (11) - content (11)
-
count
_ tdata _ objects (11) -
create
_ value (11) -
deconstruct
_ keys (2) -
delete
_ field (11) - dig (36)
- disassemble (22)
- each (22)
-
each
_ object (22) -
each
_ pair (22) - eql? (22)
- equal? (11)
- eval (11)
- filter (12)
-
first
_ lineno (11) -
have
_ struct _ member (22) - instruction (11)
- instruction? (11)
- instructions (11)
-
keyword
_ init? (3) - label (11)
- length (11)
- linger (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - malloc (11)
- members (22)
- modifiable (11)
- new (88)
-
new
_ ostruct _ member (11) -
node
_ type (11) - pack (19)
- pack テンプレート文字列 (11)
-
processing
_ instruction (11) -
rexml
/ document (11) - select (22)
- size (22)
- sizeof (11)
- tagging (11)
- target (11)
-
to
_ binary (9) -
to
_ h (23) -
to
_ i (11) -
to
_ ptr (11) - traverse (11)
- typealias (11)
- union (11)
- unpack (11)
- value (11)
- values (11)
-
values
_ at (11) - yaml (11)
検索結果
先頭5件
-
Fiddle
:: Importer # struct(signature) -> Class (21319.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 (15506.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 (15236.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] (15236.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 (15236.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] (15236.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 (15230.0) -
self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に true を返します。そうでない場合に false を返します。
...self と other のクラスが同じであり、各メンバが eql? メソッドで比較して等しい場合に
true を返します。そうでない場合に false を返します。
@param other self と比較したいオブジェクトを指定します。
//emlist[例][ruby]{
Dog = Struct.......== dog2 #=> true
p dog1.eql?(dog2) #=> true
p dog1.equal?(dog2) #=> false
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作......成する点に
注意してください。
@see Struct#==... -
Struct
# equal?(other) -> bool (15230.0) -
指定された other が self 自身である場合のみ真を返します。 これは Object クラスで定義されたデフォルトの動作で す。
...self 自身である場合のみ真を返します。
これは Object クラスで定義されたデフォルトの動作で
す。
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の......下位クラスを作成する点に
注意してください。
@see Struct#eql?, Struct#==... -
Struct
# length -> Integer (15224.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 _ at(*members) -> [object] (15224.0) -
引数で指定されたメンバの値の配列を返します。
...//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar, :baz)
obj = Foo.new('FOO', 'BAR', 'BAZ')
p obj.values_at(0, 1, 2) # => ["FOO", "BAR", "BAZ"]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new...