種類
ライブラリ
- ビルトイン (473)
- csv (22)
- etc (11)
-
fiddle
/ import (132) - json (11)
-
json
/ add / ostruct (11) -
json
/ add / struct (11) - mkmf (22)
- objspace (11)
- openssl (55)
- ostruct (108)
- rake (11)
-
rexml
/ document (110) -
rexml
/ parsers / pullparser (11) -
rexml
/ sax2listener (11) -
rexml
/ streamlistener (11) - socket (77)
- zlib (11)
クラス
- Addrinfo (33)
- Array (28)
- CSV (22)
- Data (2)
-
Fiddle
:: CStruct (55) - Hash (9)
-
OpenSSL
:: ASN1 :: Constructive (33) - OpenStruct (119)
-
REXML
:: Element (11) -
REXML
:: Instruction (88) -
REXML
:: Parsers :: PullEvent (11) -
Rake
:: Application (11) - Range (11)
- RubyVM (11)
-
RubyVM
:: InstructionSequence (225) -
Socket
:: Option (33) - String (11)
- Struct (148)
- TracePoint (6)
モジュール
- Etc (11)
-
Fiddle
:: Importer (66) - Kernel (22)
- ObjectSpace (33)
-
OpenSSL
:: ASN1 (11) -
REXML
:: SAX2Listener (11) -
REXML
:: StreamListener (11)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (11) - == (11)
- Addrinfo (11)
- CStruct (11)
- CircularDatastructure (11)
- Constructive (11)
-
DATA
_ PTR (11) -
Data
_ Get _ Struct (11) -
Data
_ Make _ Struct (11) -
Data
_ Wrap _ Struct (11) -
INSTRUCTION
_ NAMES (11) - InspectKey (11)
- Instruction (11)
- InstructionSequence (11)
- Marshal フォーマット (11)
-
NEWS for Ruby 2
. 0 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (9) -
NEWS for Ruby 2
. 7 . 0 (5) -
NEWS for Ruby 3
. 0 . 0 (4) - RBASIC (11)
- RBIGNUM (11)
- RFILE (11)
- RSTRING (11)
- Ruby用語集 (11)
-
SC
_ THREAD _ DESTRUCTOR _ ITERATIONS (11) - ZStream (11)
-
absolute
_ path (11) -
base
_ label (11) - bigdecimal (11)
-
blk
_ copy _ prev (11) -
blk
_ free (11) -
blk
_ mark (11) -
blk
_ orphan (11) -
bm
_ mark (11) - clone (11)
- compile (11)
-
compile
_ file (11) -
compile
_ option (11) -
compile
_ option= (11) - content (11)
- content= (11)
- convert (22)
-
count
_ tdata _ objects (11) -
create
_ value (11) - data (11)
-
deconstruct
_ keys (2) -
delete
_ field (11) - dig (36)
- disasm (22)
- disassemble (22)
-
dyna
_ pop (11) -
dyna
_ push (11) - each (11)
-
each
_ object (22) -
each
_ pair (44) - eval (11)
-
fc
_ i (11) -
fc
_ path (11) - fiddle (11)
-
fiddle
/ import (11) -
fiddle
/ types (11) - filter (12)
-
first
_ lineno (11) -
frame
_ dup (11) -
gvar
_ i (11) - hash (22)
-
have
_ struct _ member (22) - inspect (33)
- instruction (11)
- instruction? (11)
-
instruction
_ sequence (6) - instructions (11)
-
ivar
_ i (11) -
keyword
_ init? (3) - label (11)
- length (11)
- linger (11)
-
load
_ from _ binary (9) -
load
_ from _ binary _ extra _ data (9) - malloc (11)
-
mark
_ global _ entry (11) - modifiable (11)
- new (80)
-
new
_ blktag (11) -
new
_ dvar (11) -
node
_ type (11) - of (11)
- pack (19)
- pack テンプレート文字列 (11)
- path (11)
-
processing
_ instruction (11) -
rb
_ exec (1) -
rb
_ exec _ arg _ addopt (1) -
rb
_ exec _ arg _ fixup (1) -
rb
_ exec _ arg _ init (1) -
rb
_ exec _ err (1) -
rb
_ gc _ mark _ frame (11) -
rb
_ global _ entry (11) -
rb
_ gvar _ defined (11) -
rb
_ reserved _ word (11) -
rb
_ struct _ iv _ get (1) -
rb
_ thread _ select (1) -
rb
_ thread _ wait _ for (11) -
rb
_ time _ timespec _ new (9) -
rb
_ timespec _ now (9) -
remove
_ trace (11) -
ruby 1
. 6 feature (11) -
ruby 1
. 8 . 2 feature (11) -
ruby 1
. 9 feature (11) -
scope
_ dup (11) - select (22)
- size (22)
- sizeof (11)
-
st
_ init _ table (11) -
st
_ init _ table _ with _ size (11) - tagging (11)
- tagging= (11)
- target (11)
- target= (11)
-
to
_ a (11) -
to
_ binary (9) -
to
_ i (11) -
to
_ json (22) -
to
_ ptr (11) -
to
_ s (44) -
to
_ sockaddr (11) -
trace
_ en (11) -
trace
_ ev (11) - traverse (11)
- typealias (11)
-
undef
_ setter (11) - union (11)
- unpack (11)
-
val
_ setter (11) - value (11)
検索結果
先頭5件
-
Fiddle
:: Importer # struct(signature) -> Class (21225.0) -
C の構造体型に対応する Ruby のクラスを構築して返します。
...表記ができます。そしてそれを
配列で signature に渡してデータを定義します。例えば C における
struct timeval {
long tv_sec;
long tv_usec;
};
という構造体型に対応して
Timeval = struct(["long tv_sec", "long tv_usec"])
として構造体に......* initialize
* to_ptr
* to_i
* 構造体の各メンバへのアクセサ
返されるクラスは Fiddle::CStruct を継承しています。詳しくは
そちらを参照してください。
@param signature 構造体の各要素を文字列で表現したものの配列
require 'fid......dle/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_usec... -
TracePoint
# instruction _ sequence -> RubyVM :: InstructionSequence (15400.0) -
script_compiledイベント発生時にコンパイルされた RubyVM::InstructionSequenceインスタンスを返します。
...script_compiledイベント発生時にコンパイルされた
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 :script_compiled イベントのための
イベントフックの外側で実行した場合に発生します。... -
REXML
:: SAX2Listener # processing _ instruction(target , data) -> () (15300.0) -
XML 処理命令(PI)に対し呼び出されるコールバックメソッドです。
...XML 処理命令(PI)に対し呼び出されるコールバックメソッドです。
@param target ターゲット名が文字列で渡されます
@param data 処理命令の内容が文字列で渡されます... -
Struct
# inspect -> String (15230.0) -
self の内容を人間に読みやすい文字列にして返します。
...述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "12......3 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}... -
Struct
. keyword _ init? -> bool | nil (15134.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体が作成されたときに keyword_init: true を指定されていたら true を返します。 false を指定されていたら false を返します。 それ以外の場合は nil を返します。
...ッドは Struct の下位クラスにのみ定義されています)
構造体が作成されたときに keyword_init: true を指定されていたら true を返します。
false を指定されていたら false を返します。
それ以外の場合は nil を返します。
//emlist[例][......ruby]{
Foo = Struct.new(:a)
Foo.keyword_init? # => nil
Bar = Struct.new(:a, keyword_init: true)
Bar.keyword_init? # => true
Baz = Struct.new(:a, keyword_init: false)
Baz.keyword_init? # => false
//}... -
Struct
# filter -> Enumerator (15126.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] (15126.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
# each _ pair -> Enumerator (15124.0) -
構造体のメンバ名(Symbol)と値の組を引数にブロックを繰り返し実行します。
...mlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
Foo.new('FOO', 'BAR').each_pair {|m, v| p [m,v]}
# => [:foo, "FOO"]
# [:bar, "BAR"]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct... -
Struct
# each _ pair {|member , value| . . . } -> self (15124.0) -
構造体のメンバ名(Symbol)と値の組を引数にブロックを繰り返し実行します。
...mlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
Foo.new('FOO', 'BAR').each_pair {|m, v| p [m,v]}
# => [:foo, "FOO"]
# [:bar, "BAR"]
//}
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct... -
Struct
# dig(key , . . . ) -> object | nil (15106.0) -
self 以下のネストしたオブジェクトを dig メソッドで再帰的に参照して返し ます。途中のオブジェクトが nil であった場合は nil を返します。
...クトを dig メソッドで再帰的に参照して返し
ます。途中のオブジェクトが nil であった場合は nil を返します。
@param key キーを任意個指定します。
//emlist[例][ruby]{
klass = Struct.new(:a)
o = klass.new(klass.new({b: [1, 2, 3]}))
o.dig(:a, :a, :......b, 0) # => 1
o.dig(:b, 0) # => nil
//}
@see Array#dig, Hash#dig, OpenStruct#dig... -
RubyVM
:: InstructionSequence . compile _ file(file , options = nil) -> RubyVM :: InstructionSequence (12500.0) -
引数 file で指定した Ruby のソースコードを元にコンパイル済みの RubyVM::InstructionSequence オブジェクトを作成して返します。
...file で指定した Ruby のソースコードを元にコンパイル済みの
RubyVM::InstructionSequence オブジェクトを作成して返します。
RubyVM::InstructionSequence.compile とは異なり、file、path などの
メタデータは自動的に取得します。
@param file......tions コンパイル時のオプションを true、false、Hash オブ
ジェクトのいずれかで指定します。詳細は
RubyVM::InstructionSequence.compile_option= を参照
してください。
# /tmp/hello.rb
puts "Hello, world!"
# i......rb
RubyVM::InstructionSequence.compile_file("/tmp/hello.rb")
# => <RubyVM::InstructionSequence:<main>@/tmp/hello.rb>
@see RubyVM::InstructionSequence.compile... -
REXML
:: StreamListener # instruction(name , instruction) -> () (12400.0) -
XML処理命令(PI)をパースしたときに呼び出されるコールバックメソッドです。
...(PI)をパースしたときに呼び出されるコールバックメソッドです。
@param name ターゲット名が文字列で渡されます
@param instruction 処理命令の内容が文字列で渡されます
=== 例
<?xml-stylesheet type="text/css" href="style.css"?>
というPIに......対し
name: "xml-stylesheet"
instruction: " type=\"text/css\" href=\"style.css\""
という引数が渡されます。...