960件ヒット
[1-100件を表示]
(0.096秒)
ライブラリ
- ビルトイン (477)
- csv (6)
- date (4)
-
fiddle
/ import (72) -
json
/ add / ostruct (12) -
json
/ add / struct (12) - mkmf (24)
- openssl (36)
- ostruct (173)
- rake (12)
-
rexml
/ document (96) -
rexml
/ parsers / pullparser (12) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12)
クラス
- Array (21)
-
CSV
:: Row (6) - Data (6)
- Date (2)
- DateTime (2)
-
Fiddle
:: CStruct (24) - MatchData (4)
-
OpenSSL
:: ASN1 :: Constructive (36) - OpenStruct (185)
-
REXML
:: Element (12) -
REXML
:: Instruction (84) -
REXML
:: Parsers :: PullEvent (12) -
Rake
:: Application (12) -
RubyVM
:: InstructionSequence (130) - String (12)
- Struct (307)
- Time (2)
- TracePoint (7)
モジュール
-
Fiddle
:: Importer (48) - Kernel (24)
-
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12)
キーワード
- == (36)
- [] (24)
- []= (24)
-
absolute
_ path (12) -
base
_ label (12) - clone (12)
- content (12)
- content= (12)
-
create
_ value (12) - deconstruct (14)
-
deconstruct
_ keys (20) -
delete
_ field (12) - dig (20)
- disasm (12)
- disassemble (12)
- each (36)
-
each
_ pair (48) - eql? (24)
- equal? (12)
- eval (12)
- filter (14)
-
first
_ lineno (12) - hash (24)
-
have
_ struct _ member (24) - inspect (36)
- instruction (12)
- instruction? (12)
-
instruction
_ sequence (7) - instructions (12)
- label (12)
- length (12)
- members (12)
- modifiable (12)
-
new
_ ostruct _ member (12) -
node
_ type (12) - pack (21)
- path (12)
-
processing
_ instruction (12) - select (24)
- size (12)
- tagging (12)
- tagging= (12)
- target (12)
- target= (12)
-
to
_ a (24) -
to
_ binary (10) -
to
_ h (38) -
to
_ i (12) -
to
_ json (24) -
to
_ ptr (12) -
to
_ s (24) - union (12)
- unpack (12)
- value (12)
- values (12)
-
values
_ at (12)
検索結果
先頭5件
-
Struct
# deconstruct -> [object] (24225.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... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (24225.0) -
self のメンバの名前と値の組を Hash で返します。
...ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_keys([:zip, :address])
h # => {:zip=>12345, :address=>"123 Maple, Anytown NC"}
# 引数が nil の場合は全てのメンバを返します。
h = joe.deconstruct......:address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/patter... -
Fiddle
:: Importer # struct(signature) -> Class (24220.0) -
C の構造体型に対応する Ruby のクラスを構築して返します。
...に対応する Ruby のクラスを構築して返します。
構造体の各要素は C と似せた表記ができます。そしてそれを
配列で signature に渡してデータを定義します。例えば C における
struct timeval {
long tv_sec;
long tv_usec;
};
とい......う構造体型に対応して
Timeval = struct(["long tv_sec", "long tv_usec"])
として構造体に対応するクラスを生成します。
このメソッドが返すクラスには以下のメソッドが定義されています
* クラスメソッド malloc
* initialize
* to_ptr......アクセサ
返されるクラスは Fiddle::CStruct を継承しています。詳しくは
そちらを参照してください。
@param signature 構造体の各要素を文字列で表現したものの配列
require 'fiddle/import'
module M
extend Fiddle::Importer
dlload "li... -
Struct
# values -> [object] (21125.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... -
OpenStruct
# new _ ostruct _ member(name) -> Symbol (18201.0) -
与えられた名前のアクセサメソッドを自身に定義します。
与えられた名前のアクセサメソッドを自身に定義します。
@param name 文字列かシンボルで定義するアクセサの名前を指定します。 -
Struct
# to _ a -> [object] (18025.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... -
Struct
# equal?(other) -> bool (15131.0) -
指定された other が self 自身である場合のみ真を返します。 これは Object クラスで定義されたデフォルトの動作で す。
...たデフォルトの動作で
す。
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see Struct#eql?, Struct#==... -
Struct
# values -> [object] (15125.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 の下位クラスを作成する点に
注意してください。... -
Struct
# values _ at(*members) -> [object] (15125.0) -
引数で指定されたメンバの値の配列を返します。
...][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 は Struct... -
REXML
:: StreamListener # instruction(name , instruction) -> () (12401.0) -
XML処理命令(PI)をパースしたときに呼び出されるコールバックメソッドです。
...e ターゲット名が文字列で渡されます
@param instruction 処理命令の内容が文字列で渡されます
=== 例
<?xml-stylesheet type="text/css" href="style.css"?>
というPIに対し
name: "xml-stylesheet"
instruction: " type=\"text/css\" href=\"style.css\""
という引... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (12401.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...ルされた
RubyVM::InstructionSequenceインスタンスを返します。
//emlist[例][ruby]{
TracePoint.new(:script_compiled) do |tp|
p tp.instruction_sequence # => <RubyVM::InstructionSequence:block in <main>@(eval):1>
end.enable do
eval("puts 'hello'")
end
//}
@raise RuntimeError :scrip... -
Kernel
# have _ struct _ member(type , member , headers = nil) -> bool (12221.0) -
member というメンバを持つ構造体 type がシステムに存在するかどうか検査します。
...メンバを持つ構造体 type が存在しない場合は、偽を返します。
例えば
require 'mkmf'
have_struct_member('struct foo', 'bar') # => true
である場合、HAVE_STRUCT_FOO_BAR というプリプロセッサマクロをコンパイラに渡します。
また、後方互...