るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

モジュール

キーワード

検索結果

<< 1 2 3 > >>

BasicSocket#remote_address -> Addrinfo (21413.0)

getpeername(2) で得られたリモートアドレス情報を Addrinfo オブジェクトとして返します。

...tpeername(2) で得られたリモートアドレス情報を
Add
rinfo オブジェクトとして返します。

返されたオブジェクトの Addrinfo#protocol は 0 を
返すことに注意してください。

r
equire 'socket'

TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.remo...
...te_address #=> #<Addrinfo: 221.186.184.68:80 TCP>
}

TCPServer.open("127.0.0.1", 1728) {|serv|
c = TCPSocket.new("127.0.0.1", 1728)
s = serv.accept
p s.remote_address #=> #<Addrinfo: 127.0.0.1:36504 TCP>
}

@see BasicSocket#getpeername...

REXML::Element#add_attribute(attr) -> () (18369.0)

要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...渡す方法と REXML::Attribute オブジェクトを
渡す方法です。

文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジ...
.../emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c' b='d'/>
//...

REXML::Element#add_attribute(key, value) -> () (18369.0)

要素の属性を追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...渡す方法と REXML::Attribute オブジェクトを
渡す方法です。

文字列2つで指定する場合、属性値は unnormalized な文字列を渡す必要があります。

@param key 属性名(文字列)
@param value 属性値(文字列)
@param attr 属性(REXML::Attribute オブジ...
.../emlist[][ruby]{
r
equire 'rexml/document'
doc = REXML::Document.new("<e/>")
doc.root.add_attribute("a", "b"); doc.root # => <e a='b'/>
doc.root.add_attribute("x:a", "c"); doc.root # => <e a='b' x:a='c'/>
doc.root.add_attribute(REXML::Attribute.new("b", "d"))
doc.root # => <e a='b' x:a='c' b='d'/>
//...

REXML::Element#add_attributes(attrs) -> () (18350.0)

要素の属性を複数追加します。 同じ名前の属性がすでにある場合はその属性を新しい 属性で置き換えます。

...attrs には Hash もしくは Array を指定できます。
Hash の場合は、
{ "name1" => "value1", "name2" => "value2", ... }
という形で、配列の場合は
[ ["name1", "value1"], ["name2", "value2"], ... }
という形で追加/更新する属性を指定します。

@param attrs...
...属性の属性名と属性値の対の集合(Array or Hash)

//emlist[][ruby]{
r
equire 'rexml/document'
e = REXML::Element.new("e")
e.add_attributes({"a" => "b", "c" => "d"})
e # => <e a='b' c='d'/>
e = REXML::Element.new("e")
e.add_attributes([["a", "b"], ["c", "d"]])
e # => <e a='b' c='d'/>
//}...

REXML::Elements#add(element = nil) -> REXML::Element (18250.0)

要素 element を追加します。

...くは REXML::Element オブジェクトを
指定します。文字列を指定した場合には REXML::Element.new(element)
で生成される要素を追加します。

element を省略した場合は、空の要素が追加されます。

追加された要素が返されます。

@param el...
...ement 追加する要素

//emlist[][ruby]{
r
equire 'rexml/document'
a = REXML::Element.new('a')
a.elements.add(REXML::Element.new('b')) # => <b/>
a.to_s # => "<a><b/></a>"
a.elements.add('c') # => <c/>
a.to_s # => "<a><b/><c/></a>"
//}...

絞り込み条件を変える

BasicSocket#local_address -> Addrinfo (15313.0)

getsockname(2) で得られたローカルアドレス情報を Addrinfo オブジェクトとして返します。

...アドレス情報を
Add
rinfo オブジェクトとして返します。

返されたオブジェクトの Addrinfo#protocol は 0 を
返すことに注意してください。

r
equire 'socket'

TCPSocket.open("www.ruby-lang.org", 80) {|s|
p s.local_address #=> #<Addrinfo: 192.168.0.129:...
...36873 TCP>
}

TCPServer.open("127.0.0.1", 1512) {|serv|
p serv.local_address #=> #<Addrinfo: 127.0.0.1:1512 TCP>
}

@see BasicSocket#getsockname...

REXML::Child#previous_sibling=(other) (15249.0)

other を self の前の隣接ノードとします。

...other を self の前の隣接ノードとします。

つまり、親ノードが持つ子ノード列の self の前に
other を挿入します。

@param other 挿入するノード

//emlist[][ruby]{
r
equire 'rexml/document'

a = REXML::Element.new("a")
b
= a.add_element("b")
c = REXML::Eleme...
...nt.new("c")
b
.next_sibling = c
d = REXML::Element.new("d")
b
.previous_sibling = d

p a.to_s # => "<a><d/><b/><c/></a>"
//}...

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (12425.0)

要素から key という属性名の属性を削除します。

...

@param key 削除する要素(文字列(属性名) or REXML::Attributeオブジェクト)

//emlist[][ruby]{
r
equire 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x")...
...; e # => <E y:x='bar'/>
//}...

Thread#add_trace_func(pr) -> Proc (12226.0)

スレッドにトレース用ハンドラを追加します。

...@param pr トレースハンドラ(Proc オブジェクト)

//emlist[例][ruby]{
th = Thread.new do
class Trace
end
43.to_s
end
th.add_trace_func lambda {|*arg| p arg }
th.join

# => ["line", "example.rb", 4, nil, #<Binding:0x00007f98e107d0d8>, nil]
# => ["c-call", "example.rb", 4, :inherite...
...d, #<Binding:0x00007f98e1087448>, Class]
# => ["c-return", "example.rb", 4, :inherited, #<Binding:0x00007f98e1085d00>, Class]
# => ["class", "example.rb", 4, nil, #<Binding:0x00007f98e108f210>, nil]
# => ["end", "example.rb", 5, nil, #<Binding:0x00007f98e108e5e0>, nil]
# => ["line", "example.rb", 6,...
...nil, #<Binding:0x00007f98e108d4b0>, nil]
# => ["c-call", "example.rb", 6, :to_s, #<Binding:0x00007f98e1097aa0>, Integer]
# => ["c-return", "example.rb", 6, :to_s, #<Binding:0x00007f98e1095cc8>, Integer]
//}

@see Thread#set_trace_func Kernel.#set_trace_func...
<< 1 2 3 > >>