種類
ライブラリ
- ビルトイン (729)
- csv (6)
- date (4)
- etc (30)
-
fiddle
/ import (120) - json (12)
-
json
/ add / ostruct (24) -
json
/ add / struct (24) - mkmf (24)
- objspace (12)
- openssl (60)
- ostruct (209)
- rake (12)
-
rexml
/ document (120) -
rexml
/ parsers / pullparser (12) -
rexml
/ sax2listener (12) -
rexml
/ streamlistener (12) - socket (12)
クラス
- Addrinfo (12)
- Array (21)
-
CSV
:: Row (6) - Data (6)
- Date (2)
- DateTime (2)
-
Fiddle
:: CStruct (60) - MatchData (4)
-
OpenSSL
:: ASN1 :: Constructive (36) - OpenStruct (221)
-
REXML
:: Element (12) -
REXML
:: Instruction (96) -
REXML
:: Parsers :: PullEvent (12) -
Rake
:: Application (12) - Range (12)
- RubyVM (12)
-
RubyVM
:: InstructionSequence (246) - String (12)
- Struct (383)
- Time (2)
- TracePoint (7)
モジュール
- Etc (12)
-
Fiddle
:: Importer (48) - Kernel (24)
- ObjectSpace (36)
-
OpenSSL
:: ASN1 (12) -
REXML
:: SAX2Listener (12) -
REXML
:: StreamListener (12)
キーワード
-
1
. 6 . 8から1 . 8 . 0への変更点(まとめ) (12) - == (36)
- CStruct (12)
- CircularDatastructure (12)
- Constructive (12)
-
DATA
_ PTR (12) -
Data
_ Get _ Struct (12) -
Data
_ Make _ Struct (12) -
Data
_ Wrap _ Struct (12) - Group (9)
-
INSTRUCTION
_ NAMES (12) - InspectKey (12)
- Instruction (12)
- InstructionSequence (12)
- Marshal フォーマット (12)
-
NEWS for Ruby 2
. 0 . 0 (12) -
NEWS for Ruby 2
. 2 . 0 (11) -
NEWS for Ruby 2
. 3 . 0 (10) -
NEWS for Ruby 2
. 5 . 0 (8) -
NEWS for Ruby 2
. 6 . 0 (7) -
NEWS for Ruby 2
. 7 . 0 (6) -
NEWS for Ruby 3
. 0 . 0 (5) -
NEWS for Ruby 3
. 1 . 0 (4) - OpenStruct (12)
- Passwd (9)
- 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
_ DATA _ FUNC (12) - Ruby用語集 (12)
-
SC
_ THREAD _ DESTRUCTOR _ ITERATIONS (12) - [] (36)
- []= (24)
-
absolute
_ path (12) -
base
_ label (12) - bigdecimal (12)
-
blk
_ copy _ prev (12) -
blk
_ free (12) -
blk
_ mark (12) -
blk
_ orphan (12) -
bm
_ mark (12) - clone (12)
- compile (12)
-
compile
_ file (12) -
compile
_ option (12) -
compile
_ option= (12) - content (12)
- content= (12)
-
count
_ tdata _ objects (12) -
create
_ value (12) - deconstruct (14)
-
deconstruct
_ keys (20) -
delete
_ field (12) - dig (20)
- disasm (24)
- disassemble (24)
-
dyna
_ pop (12) -
dyna
_ push (12) - each (36)
-
each
_ object (24) -
each
_ pair (48) - eql? (24)
- equal? (12)
- eval (12)
-
fc
_ i (12) -
fc
_ path (12) - filter (14)
-
first
_ lineno (12) -
frame
_ dup (12) -
gvar
_ i (12) - hash (24)
-
have
_ struct _ member (24) - inspect (36)
- instruction (12)
- instruction? (12)
-
instruction
_ sequence (7) - instructions (12)
-
ivar
_ i (12) -
json
/ add / ostruct (12) -
json
/ add / struct (12) -
json
_ create (24) -
keyword
_ init? (4) - label (12)
- length (12)
-
load
_ from _ binary (10) -
load
_ from _ binary _ extra _ data (10) - malloc (12)
-
mark
_ global _ entry (12) - members (24)
- modifiable (12)
- new (108)
-
new
_ blktag (12) -
new
_ dvar (12) -
new
_ ostruct _ member (12) -
node
_ type (12) - of (12)
- ostruct (12)
- pack (21)
- pack テンプレート文字列 (12)
- path (12)
-
processing
_ instruction (12) -
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 (12) -
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) -
rb
_ timespec _ now (10) -
remove
_ trace (12) -
rexml
/ document (12) -
ruby 1
. 6 feature (12) -
ruby 1
. 8 . 2 feature (12) -
ruby 1
. 9 feature (12) -
scope
_ dup (12) - select (24)
- size (24)
-
st
_ init _ table (12) -
st
_ init _ table _ with _ size (12) - struct (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) -
trace
_ en (12) -
trace
_ ev (12) - traverse (12)
-
undef
_ setter (12) - union (12)
- unpack (12)
-
val
_ setter (12) - value (12)
- values (12)
-
values
_ at (12)
検索結果
先頭5件
-
Struct (44022.0)
-
構造体クラス。Struct.new はこのクラスのサブクラスを新たに生成します。
...構造体クラス。Struct.new はこのクラスのサブクラスを新たに生成します。
個々の構造体はサブクラスから Struct.new を使って生成します。個々
の構造体サブクラスでは構造体のメンバに対するアクセスメソッドが定義され
て... -
Struct
# deconstruct -> [object] (36224.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 (36224.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... -
Struct
# values -> [object] (33124.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
# to _ a -> [object] (30024.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 (27130.0) -
指定された other が self 自身である場合のみ真を返します。 これは Object クラスで定義されたデフォルトの動作で す。
...たデフォルトの動作で
す。
[注意] 本メソッドの記述は Struct の下位クラスのインスタンスに対して呼び
出す事を想定しています。Struct.new は Struct の下位クラスを作成する点に
注意してください。
@see Struct#eql?, Struct#==... -
Struct
# values -> [object] (27124.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] (27124.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... -
static void undef
_ setter(VALUE val , ID id , void *data , struct global _ variable *var) (26200.0) -
-
Struct
. new(*args , keyword _ init: nil) {|subclass| block } -> Class (24300.0) -
Struct クラスに新しいサブクラスを作って、それを返します。
...
Struct クラスに新しいサブクラスを作って、それを返します。
サブクラスでは構造体のメンバに対するアクセスメソッドが定義されています。
//emlist[例][ruby]{
dog = Struct.new("Dog", :name, :age)
fred = dog.new("fred", 5)
fred.age = 6
printf "......* true: キーワード引数のみ使用できる
* false: キーワード引数は使用できず、位置引数のみ使用できる
//emlist[例][ruby]{
Point1 = Struct.new(:x, :y)
Point1.new(1, 2) # => #<struct Point1 x=1, y=2>
Point1.new(x: 1, y: 2) # => #<struct Point......(x: 1) # => #<struct Point1 x=1, y=nil>
Point1.new(y: 2) # => #<struct Point1 x=nil, y=2>
Point1.new(x: 1, y: 2, z: 3) # => ArgumentError (unknown keywords: z)
Point2 = Struct.new(:x, :y, keyword_init: nil)
Point2.new(1, 2) # => #<struct Point2 x=1, y=2>
Point2.n... -
Struct
. [](*args) -> Struct (24255.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}... -
Struct
. new(*args) -> Struct (24255.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}... -
Struct
. [](*args) -> Struct (24244.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}... -
Struct
. new(*args) -> Struct (24244.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}... -
Struct
. [](*args) -> Struct (24239.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}... -
Struct
. new(*args) -> Struct (24239.0) -
(このメソッドは Struct の下位クラスにのみ定義されています) 構造体オブジェクトを生成して返します。
...(このメソッドは Struct の下位クラスにのみ定義されています)
構造体オブジェクトを生成して返します。
@param args 構造体の初期値を指定します。メンバの初期値は指定されなければ nil です。
@return 構造体クラスのインス......タンス。
@raise ArgumentError 構造体のメンバの数よりも多くの引数を指定した場合に発生します。
//emlist[例][ruby]{
Foo = Struct.new(:foo, :bar)
foo = Foo.new(1)
p foo.values # => [1, nil]
//}...