るりまサーチ

最速Rubyリファレンスマニュアル検索!
55件ヒット [1-55件を表示] (0.074秒)
トップページ > クエリ:l[x] > クエリ:attr[x] > クエリ:each[x]

別のキーワード

  1. matrix l
  2. kernel $-l
  3. _builtin $-l
  4. lupdecomposition l
  5. l matrix

ライブラリ

検索結果

REXML::Attributes#each {|name, value| ... } -> () (24207.0)

各属性の名前と値に対しブロックを呼び出します。

...d_name(REXML::Namespace#exapnded_name)が
渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/r...
...oot/a").first

a.attributes.each do |name, value|
p [name, value]
end

# => ["foo:att", "1"]
# => ["bar:att", "2"]
# => ["att", "<"]
//}...

REXML::Element#each_element_with_attribute(key, value = nil, max = 0, name = nil) {|element| ... } -> () (18425.0)

特定の属性を持つすべての子要素を引数としてブロックを呼び出します。

...を呼び出します。

key で指定した属性名の属性を持つ要素のみを対象とします。
value を指定すると、keyで指定した属性名を持つ属性の値がvalueである
もののみを対象とします。
maxを指定すると、対象となる子要素の先頭 max...
...列)
@param value 属性値(文字列)
@param max ブロック呼出の対象とする子要素の最大個数
@param name xpath文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new("<a><b id='1'/><c id='2'/><d id='1'/><e/></a>")
doc.root.each_element_with_attribute('id'){|...
...b id='1'/>
# >> <c id='2'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1'){|e| p e }
# >> <b id='1'/>
# >> <d id='1'/>
doc.root.each_element_with_attribute('id', '1', 1){|e| p e }
# >> <b id='1'/>
doc.root.each_element_with_attribute('id', '1', 0, 'd'){|e| p e }
# >> <d id='1'/>
//...

REXML::Attributes#each_attribute {|attribute| ... } -> () (18331.0)

各属性に対しブロックを呼び出します。

...は REXML::Attribute オブジェクトで渡されます。

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/r...
...oot/a").first

a.attributes.each_attribute do |attr|
p [attr.namespace, attr.name, attr.value]
end
# => ["http://example.org/foo", "att", "1"]
# => ["http://example.org/bar", "att", "2"]
# => ["", "att", "<"]
//}...

WIN32OLE_EVENT#handler=(obj) -> () (9112.0)

イベント処理を実行するオブジェクトを登録します。

...るにはnilを指定します。

class IeHandler
def initialize
@completed = false
end
attr
_reader :completed
def onDocumentComplete(disp, uri)
disp.document.getElementsByTagName('a').each do |e|
puts "#{e.innerHTML}=#{e.href}"
end
@completed = tru...
...ie = WIN32OLE.new('InternetExplorer.Application.1')
event = WIN32OLE_EVENT.new(ie, 'DWebBrowserEvents2')
event.handler = IeHandler.new
ie.Navigate2 'http://www.ruby-lang.org/ja/'
l
oop do
break if event.handler.completed
WIN32OLE_EVENT.message_loop
end
ie.Quit

WIN32OLE_EVENT#on_...

WIN32OLE_TYPE#default_event_sources -> [WIN32OLE_TYPE] (6112.0)

型が持つソースインターフェイスを取得します。

...型が持つソースインターフェイスを取得します。

default_event_sourcesメソッドは、selfがCoClass(コンポーネントクラス)
の場合、そのクラスがサポートするデフォルトのソースインターフェイス(イ
ベントの通知元となるイン...
...uire 'win32ole'

type = WIN32OLE_TYPE.new('Microsoft Internet Controls', 'InternetExplorer')
ctl = WIN32OLE.new(type.progid)
source = type.default_event_sources[0]
class WebEvent
def initialize
@completed = false
end
attr
_reader :completed
end
source.ole_methods.each do |m|
W...
...odule_eval do
define_method("on#{m.name}") do |*arg|
if arg[0] == "ページが表示されました"
@completed = true
end
puts "#{Time.now}: #{m.name} was called"
p arg
end
end
end
evt = WIN32OLE_EVENT.new(ctl)
evt.handler = WebEvent.new
ctl.na...

絞り込み条件を変える