942件ヒット
[1-100件を表示]
(0.132秒)
ライブラリ
- ビルトイン (339)
- csv (42)
- date (4)
-
fiddle
/ import (96) -
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) - socket (60)
クラス
- Addrinfo (24)
- Array (31)
- CSV (36)
-
CSV
:: Row (6) - Data (6)
- Date (2)
- DateTime (2)
-
Fiddle
:: CStruct (24) - Hash (10)
- MatchData (4)
-
OpenSSL
:: ASN1 :: Constructive (36) - OpenStruct (185)
-
REXML
:: Element (12) -
REXML
:: Instruction (84) -
REXML
:: Parsers :: PullEvent (12) -
Rake
:: Application (12) -
RubyVM
:: InstructionSequence (130) -
Socket
:: Option (36) - String (12)
- Struct (149)
- Time (2)
- TracePoint (7)
モジュール
-
Fiddle
:: Importer (72) - Kernel (24)
-
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12)
キーワード
- == (24)
- [] (12)
- []= (12)
-
absolute
_ path (12) -
base
_ label (12) - clone (12)
- content (12)
- content= (12)
- convert (36)
-
create
_ value (12) - data (12)
- deconstruct (14)
-
deconstruct
_ keys (20) -
delete
_ field (12) - dig (40)
- disasm (12)
- disassemble (12)
- each (24)
-
each
_ pair (36) - eql? (12)
- eval (12)
- filter (7)
-
first
_ lineno (12) - hash (24)
-
have
_ struct _ member (24) - inspect (36)
- instruction (12)
- instruction? (12)
-
instruction
_ sequence (7) - instructions (12)
- label (12)
- length (12)
- linger (12)
- modifiable (12)
-
new
_ ostruct _ member (12) -
node
_ type (12) - pack (21)
- path (12)
-
processing
_ instruction (12) - select (12)
- size (12)
- sizeof (12)
- tagging (12)
- tagging= (12)
- target (12)
- target= (12)
-
to
_ a (18) -
to
_ binary (10) -
to
_ h (19) -
to
_ i (12) -
to
_ json (24) -
to
_ ptr (12) -
to
_ s (48) -
to
_ sockaddr (12) - typealias (12)
- union (12)
- unpack (12)
- value (12)
- values (6)
検索結果
先頭5件
-
Struct
# deconstruct -> [object] (21225.0) -
構造体のメンバの値を配列にいれて返します。
... 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.n......ew は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Struct
# deconstruct _ keys(array _ of _ names) -> Hash (21225.0) -
self のメンバの名前と値の組を Hash で返します。
...array_of_names 返り値に含めるメンバの名前の配列を指定します。nil の場合は全てのメンバを意味します。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
h = joe.deconstruct_keys([:z......12345, :address=>"123 Maple, Anytown NC"}
# 引数が nil の場合は全てのメンバを返します。
h = joe.deconstruct_keys(nil)
h # => {:name=>"Joseph Smith, Jr.", :address=>"123 Maple, Anytown NC", :zip=>12345}
//}
[注意] 本メソッドの記述は Struct の下位クラスのイン......スタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects... -
Fiddle
:: Importer # struct(signature) -> Class (18220.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 を継承しています。詳しくは
そちらを参照してください。
@param signature 構造体の各要素を文字列で......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_usec... -
REXML
:: Element # instructions -> [REXML :: Instraction] (15401.0) -
すべての instruction 子ノードの配列を返します。
...すべての instruction 子ノードの配列を返します。
返される配列は freeze されます。... -
OpenStruct
# new _ ostruct _ member(name) -> Symbol (15201.0) -
与えられた名前のアクセサメソッドを自身に定義します。
...与えられた名前のアクセサメソッドを自身に定義します。
@param name 文字列かシンボルで定義するアクセサの名前を指定します。... -
Struct
# inspect -> String (15131.0) -
self の内容を人間に読みやすい文字列にして返します。
...の記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith......", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<struct Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}... -
Struct
# length -> Integer (15125.0) -
構造体のメンバの数を返します。
...の記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
//emlist[例][ruby]{
Customer = Struct.new(:name, :address, :zip)
joe = Customer.new("Joe Smith......", "123 Maple, Anytown NC", 12345)
joe.length #=> 3
//}... -
Struct
# to _ json(*args) -> String (15107.0) -
自身を JSON 形式の文字列に変換して返します。
...身を JSON 形式の文字列に変換して返します。
内部的にはハッシュにデータをセットしてから JSON::Generator::GeneratorMethods::Hash#to_json を呼び出しています。
@param args 引数はそのまま JSON::Generator::GeneratorMethods::Hash#to_json に渡され......ます。
//emlist[例][ruby]{
require "json/add/core"
Person = Struct.new(:name, :age)
Person.new("tanaka", 29).to_json # => "{\"json_class\":\"Person\",\"v\":[\"tanaka\",29]}"
//}
@see JSON::Generator::GeneratorMethods::Hash#to_json... -
RubyVM
:: InstructionSequence # inspect -> String (15101.0) -
self の情報をラベルとパスを含んだ人間に読みやすい文字列にして返します。
...んだ人間に読みやすい文字列にして返します。
//emlist[例][ruby]{
iseq = RubyVM::InstructionSequence.compile('num = 1 + 2')
iseq.inspect # => "<RubyVM::InstructionSequence:<compiled>@<compiled>>"
//}
@see RubyVM::InstructionSequence#label,
RubyVM::InstructionSequence#path... -
Struct
# to _ a -> [object] (15025.0) -
構造体のメンバの値を配列にいれて返します。
... 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.n......ew は Struct の下位クラスを作成する点に
注意してください。
@see d:spec/pattern_matching#matching_non_primitive_objects...