るりまサーチ

最速Rubyリファレンスマニュアル検索!
344件ヒット [201-300件を表示] (0.056秒)

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 > >>

Socket::Constants::AI_PASSIVE -> Integer (132.0)

Get address to use with bind。

...Get address to use with bind。

Socket.getaddrinfo, Addrinfo.getaddrinfo の引数 flags に渡す
定数です。

@see getaddrinfo(3)...

Socket::Constants::INADDR_ANY -> Integer (132.0)

A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address。 IPv4アドレスの 0.0.0.0 に対応する整数です。

...A socket bound to INADDR_ANY receives packets from
all interfaces and sends from the default IP address
IPv4アドレスの 0.0.0.0 に対応する整数です。

@see netinet/in.h(header), ip(7linux), ip(4freebsd)...

Socket::Constants::IP_ONESBCAST -> Integer (132.0)

Force outgoing broadcast datagrams to have the undirected broadcast address。 BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。

...Force outgoing broadcast datagrams to have the undirected broadcast address
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。

@see Socket::Constants::IPPROTO_IP, ip(4freebsd)...

Socket::INADDR_ANY -> Integer (132.0)

A socket bound to INADDR_ANY receives packets from all interfaces and sends from the default IP address。 IPv4アドレスの 0.0.0.0 に対応する整数です。

...A socket bound to INADDR_ANY receives packets from
all interfaces and sends from the default IP address
IPv4アドレスの 0.0.0.0 に対応する整数です。

@see netinet/in.h(header), ip(7linux), ip(4freebsd)...

Socket::IP_ONESBCAST -> Integer (132.0)

Force outgoing broadcast datagrams to have the undirected broadcast address。 BasicSocket#getsockopt, BasicSocket#setsockopt の第2引数(optname)に使用します。

...Force outgoing broadcast datagrams to have the undirected broadcast address
BasicSocket#getsockopt, BasicSocket#setsockopt
の第2引数(optname)に使用します。

@see Socket::Constants::IPPROTO_IP, ip(4freebsd)...

絞り込み条件を変える

Struct.new(*args, keyword_init: nil) -> Class (118.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...ct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

# keyword_init: false...
...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Struct.new(*args, keyword_init: nil) {|subclass| block } -> Class (118.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...ct.new(:x, :y)
Point.new(x: 1, y: 2) # => #<struct Point x={:x=>1, :y=>2}, y=nil>
# warning: Passing only keyword arguments to Struct#initialize will behave differently from Ruby 3.2. Please use a Hash literal like .new({k: v}) instead of .new(k: v).

# keyword_init: false...
...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Data#inspect -> String (113.0)

self の内容を人間に読みやすい文字列にして返します。

...字列にして返します。

//emlist[例][ruby]{
Customer = Data.define(:name, :address, :zip)
joe = Customer.new("Joe Smith", "123 Maple, Anytown NC", 12345)
joe.inspect # => "#<data Customer name=\"Joe Smith\", address=\"123 Maple, Anytown NC\", zip=12345>"
//}

[注意] 本メソッドの記...

Struct#deconstruct -> [object] (113.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#inspect -> String (113.0)

self の内容を人間に読みやすい文字列にして返します。

...クラスを作成する点に
注意してください。

//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#values -> [object] (113.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(*args) -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Struct.new(*args) {|subclass| block } -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Struct.new(*args, keyword_init: false) -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Struct.new(*args, keyword_init: false) {|subclass| block } -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

絞り込み条件を変える

Struct.new(*args, keyword_init: nil) -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...

Struct.new(*args, keyword_init: nil) {|subclass| block } -> Class (112.0)

Struct クラスに新しいサブクラスを作って、それを返します。

...以下のような指定はエラーになります。

//emlist[例][ruby]{
p Struct.new('foo', 'bar')
# => -:1:in `new': identifier foo needs to be constant (NameError)
//}

また args[1..-1] は、Symbol か String で指定します。

//emlist[例][ruby]{
p Struct.new("Foo", :foo, :bar) # =...
...、定義した Struct はブロックパラメータにも渡さ
れます。

//emlist[例][ruby]{
Customer = Struct.new(:name, :address) do
def greeting
"Hello #{name}!"
end
end
Customer.new("Dave", "123 Main").greeting # => "Hello Dave!"
//}

Structをカスタマイズする場合はこ...
<< < 1 2 3 4 > >>